1 | <?php |
||
18 | class LogicalOperator extends Criterion |
||
19 | { |
||
20 | /** |
||
21 | * Parses input structure to a Criterion object. |
||
22 | * |
||
23 | * @param array $data |
||
24 | * @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher |
||
25 | * |
||
26 | * @return \eZ\Publish\API\Repository\Values\Content\Query\Criterion\LogicalOperator |
||
27 | * |
||
28 | * @throws \Exception |
||
29 | * @throws \eZ\Publish\Core\REST\Common\Exceptions\Parser |
||
30 | */ |
||
31 | public function parse(array $data, ParsingDispatcher $parsingDispatcher) |
||
35 | |||
36 | /** |
||
37 | * @param array $criteriaByType |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | protected function getFlattenedCriteriaData(array $criteriaByType): array |
||
73 | |||
74 | /** |
||
75 | * Checks if the given $value is zero based. |
||
76 | * |
||
77 | * @param array $value |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | protected function isZeroBasedArray(array $value): bool |
||
87 | |||
88 | /** |
||
89 | * Normalize list of criteria to be provided as the expected criterion type to its value map. |
||
90 | * |
||
91 | * Changes: |
||
92 | * <code> |
||
93 | * [ |
||
94 | * 0 => "CriterionType1" => "<value1>", |
||
95 | * 1 => "CriterionType1" => "<value2>", |
||
96 | * 2 => "CriterionType2" => "<value3>", |
||
97 | * ] |
||
98 | * </code> |
||
99 | * into: |
||
100 | * <code> |
||
101 | * [ |
||
102 | * "CriterionType1" => ["<value1>", "<value2>"], |
||
103 | * "CriterionType2" => ["<value3>"], |
||
104 | * ] |
||
105 | * </code> |
||
106 | * |
||
107 | * @param array $criterionList zero-based list of criteria |
||
108 | * |
||
109 | * @return array map of criterion types to their values |
||
110 | */ |
||
111 | private function normalizeCriteriaByType(array $criterionList): array |
||
126 | } |
||
127 |
If you suppress an error, we recommend checking for the error condition explicitly: