| @@ 107-113 (lines=7) @@ | ||
| 104 | } |
|
| 105 | ||
| 106 | switch ($key) { |
|
| 107 | case self::MATCH_DEPTH: |
|
| 108 | $match = reset($values); |
|
| 109 | $operator = key($values); |
|
| 110 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 111 | throw new \Exception("Can not use '$operator' as comparison operator for depth"); |
|
| 112 | } |
|
| 113 | return new Query\Criterion\Location\Depth(self::$operatorsMap[$operator], $match); |
|
| 114 | ||
| 115 | case self::MATCH_IS_MAIN_LOCATION: |
|
| 116 | case 'is_main': |
|
| @@ 125-131 (lines=7) @@ | ||
| 122 | return new Query\Criterion\Location\IsMainLocation(Query\Criterion\Location\IsMainLocation::NOT_MAIN); |
|
| 123 | } |
|
| 124 | ||
| 125 | case self::MATCH_PRIORITY: |
|
| 126 | $match = reset($values); |
|
| 127 | $operator = key($values); |
|
| 128 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 129 | throw new \Exception("Can not use '$operator' as comparison operator for depth"); |
|
| 130 | } |
|
| 131 | return new Query\Criterion\Location\Priority(self::$operatorsMap[$operator], $match); |
|
| 132 | } |
|
| 133 | ||
| 134 | return parent::getQueryCriterion($key, $values); |
|
| @@ 140-146 (lines=7) @@ | ||
| 137 | case self::MATCH_CONTENT_TYPE_IDENTIFIER: |
|
| 138 | return new Query\Criterion\ContentTypeIdentifier($values); |
|
| 139 | ||
| 140 | case self::MATCH_CREATION_DATE: |
|
| 141 | $match = reset($values); |
|
| 142 | $operator = key($values); |
|
| 143 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 144 | throw new \Exception("Can not use '$operator' as comparison operator for dates"); |
|
| 145 | } |
|
| 146 | return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match); |
|
| 147 | ||
| 148 | case self::MATCH_GROUP: |
|
| 149 | foreach($values as &$value) { |
|
| @@ 159-165 (lines=7) @@ | ||
| 156 | case self::MATCH_LANGUAGE_CODE: |
|
| 157 | return new Query\Criterion\LanguageCode($values); |
|
| 158 | ||
| 159 | case self::MATCH_MODIFICATION_DATE: |
|
| 160 | $match = reset($values); |
|
| 161 | $operator = key($values); |
|
| 162 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 163 | throw new \Exception("Can not use '$operator' as comparison operator for dates"); |
|
| 164 | } |
|
| 165 | return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match); |
|
| 166 | ||
| 167 | case self::MATCH_OBJECT_STATE: |
|
| 168 | foreach($values as &$value) { |
|