forked from ezsystems/ezpublish-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CriterionHandler.php
57 lines (50 loc) · 1.7 KB
/
CriterionHandler.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* File containing the InMemory criterion handler class
*
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\Core\Persistence\InMemory;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
abstract class CriterionHandler
{
/**
* @var \eZ\Publish\Core\Persistence\InMemory\LocationSearchHandler
*/
protected $locationSearchHandler;
/**
* @var \eZ\Publish\Core\Persistence\InMemory\Backend
*/
protected $backend;
/**
* Creates a new criterion handler
*
* @param \eZ\Publish\Core\Persistence\InMemory\LocationSearchHandler $locationSearchHandler
* @param \eZ\Publish\Core\Persistence\InMemory\Backend $backend
*/
public function __construct( LocationSearchHandler $locationSearchHandler, Backend $backend )
{
$this->locationSearchHandler = $locationSearchHandler;
$this->backend = $backend;
}
/**
* Check if this criterion handler accepts to handle the given criterion.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
*
* @return boolean
*/
abstract public function accept( Criterion $criterion );
/**
* Generate query expression for a Criterion this handler accepts
*
* accept() must be called before calling this method.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
* @param array $match
* @param array $excludeMatch
*/
abstract public function handle( Criterion $criterion, array &$match, array &$excludeMatch );
}