Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Persistence/Legacy/URL/Query/CriteriaConverter.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Legacy\URL\Query;
8
9 use eZ\Publish\API\Repository\Exceptions\NotImplementedException;
10 use eZ\Publish\API\Repository\Values\URL\Query\Criterion;
11 use eZ\Publish\Core\Persistence\Database\SelectQuery;
12
13 class CriteriaConverter
14 {
20 protected $handlers;
21
27 public function __construct(array $handlers = [])
28 {
29 $this->handlers = $handlers;
30 }
31
37 public function addHandler(CriterionHandler $handler)
38 {
39 $this->handlers[] = $handler;
40 }
41
52 public function convertCriteria(SelectQuery $query, Criterion $criterion)
53 {
54 foreach ($this->handlers as $handler) {
55 if ($handler->accept($criterion)) {
56 return $handler->handle($this, $query, $criterion);
57 }
58 }
59
60 throw new NotImplementedException(
61 'No visitor available for: ' . get_class($criterion)
62 );
63 }
64 }
eZ\Publish\API\Repository\Exceptions\NotImplementedException
This Exception is thrown if a feature has not been implemented intentionally.
Definition: API/Repository/Exceptions/NotImplementedException.php:15
eZ\Publish\API\Repository\Values\URL\Query\Criterion
Definition: API/Repository/Values/URL/Query/Criterion.php:10
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:14
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter\__construct
__construct(array $handlers=[])
Construct from an optional array of Criterion handlers.
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:27
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter\convertCriteria
convertCriteria(SelectQuery $query, Criterion $criterion)
Generic converter of criteria into query fragments.
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:52
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter\addHandler
addHandler(CriterionHandler $handler)
Adds handler.
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:37
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriteriaConverter\$handlers
$handlers
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:20
eZ\Publish\Core\Persistence\Database\SelectQuery
Definition: SelectQuery.php:16
eZ\Publish\Core\Persistence\Legacy\URL\Query\CriterionHandler
Definition: Persistence/Legacy/URL/Query/CriterionHandler.php:13
eZ\Publish\API\Repository\Values\URL\Query\Criterion
Definition: API/Repository/Values/URL/Query/Criterion/LogicalAnd.php:7
eZ\Publish\Core\Persistence\Legacy\URL\Query
Definition: Persistence/Legacy/URL/Query/CriteriaConverter.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.