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

Core/REST/Server/Input/Parser/Criterion/LogicalNot.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\Server\Input\Parser\Criterion as CriterionParser;
10 use eZ\Publish\Core\REST\Common\Input\ParsingDispatcher;
11 use eZ\Publish\Core\REST\Common\Exceptions;
12 use eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalNot as LogicalNotCriterion;
13
17 class LogicalNot extends CriterionParser
18 {
29 public function parse(array $data, ParsingDispatcher $parsingDispatcher)
30 {
31 if (!array_key_exists('NOT', $data) && !is_array($data['NOT'])) {
32 throw new Exceptions\Parser('Invalid <NOT> format');
33 }
34
35 if (count($data['NOT']) > 1) {
36 throw new Exceptions\Parser('NOT element can only contain one subitem');
37 }
38 $criterionName = key($data['NOT']);
39 $criterionData = current($data['NOT']);
40 $criteria = $this->dispatchCriterion($criterionName, $criterionData, $parsingDispatcher);
41
42 return new LogicalNotCriterion($criteria);
43 }
44 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalNot
A NOT logical criterion.
Definition: API/Repository/Values/Content/Query/Criterion/LogicalNot.php:15
eZ\Publish\Core\REST\Common\Input\ParsingDispatcher
Parsing dispatcher.
Definition: ParsingDispatcher.php:15
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalNot
Parser for LogicalNot Criterion.
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalNot.php:18
eZ\Publish\Core\REST\Server\Input\Parser\Criterion\LogicalNot\parse
parse(array $data, ParsingDispatcher $parsingDispatcher)
Parses input structure to a Criterion object.
Definition: Core/REST/Server/Input/Parser/Criterion/LogicalNot.php:29
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+.