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

Core/REST/Server/Input/Parser/Criterion/LogicalAnd.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Server\Input\Parser\Criterion;
8
9 use eZ\Publish\Core\REST\Common\Input\ParsingDispatcher;
10 use eZ\Publish\Core\REST\Common\Exceptions;
11 use eZ\Publish\API\Repository\Values;
12
16 class LogicalAnd extends LogicalOperator
17 {
19 const TAG_NAME = 'AND';
20
31 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
32 {
33 if (!array_key_exists(static::TAG_NAME, $data) || !is_array($data[static::TAG_NAME])) {
34 throw new Exceptions\Parser('Invalid <' . static::TAG_NAME . '> format');
35 }
36
37 $criteria = [];
38
39 $flattenedCriteriaElements = $this->getFlattenedCriteriaData($data[static::TAG_NAME]);
40 foreach ($flattenedCriteriaElements as $criterionElement) {
41 $criteria[] = $this->dispatchCriterion(
42 $criterionElement['type'],
43 $criterionElement['data'],
44 $parsingDispatcher
45 );
46 }
47
48 return new Values\Content\Query\Criterion\LogicalAnd($criteria);
49 }
50 }
eZ\Publish\Core\REST\Common\Input\ParsingDispatcher
Parsing dispatcher.
Definition: ParsingDispatcher.php:15
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalAnd
Parser for LogicalAnd Criterion.
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalAnd.php:17
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalAnd\TAG_NAME
const TAG_NAME
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalAnd.php:19
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalAnd\parse
parse(array $data, ParsingDispatcher $parsingDispatcher)
Parses input structure to a LogicalAnd Criterion object.
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalAnd.php:31
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalOperator
Parser for LogicalOperator Criterion.
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalOperator.php:19
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalOperator\getFlattenedCriteriaData
getFlattenedCriteriaData(array $criteriaByType)
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalOperator.php:41
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\dispatchCriterion
dispatchCriterion($criterionName, $criterionData, ParsingDispatcher $parsingDispatcher)
Dispatches parsing of a criterion name + data to its own parser.
Definition: Core/REST/Server/Input/Parser/Criterion.php:36
eZ\Publish\Core\REST\Common\Exceptions
Definition: Core/REST/Common/Exceptions/ForbiddenException.php:7
eZ\Publish\Core\REST\Server\Input\Parser\Criterion
Definition: Core/REST/Server/Input/Parser/Criterion/Ancestor.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.