| @@ 86-92 (lines=7) @@ | ||
| 83 | } |
|
| 84 | ||
| 85 | switch ($key) { |
|
| 86 | case self::MATCH_DEPTH: |
|
| 87 | $match = reset($values); |
|
| 88 | $operator = key($values); |
|
| 89 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 90 | throw new \Exception("Can not use '$operator' as comparison operator for depth"); |
|
| 91 | } |
|
| 92 | return new Query\Criterion\Location\Depth(self::$operatorsMap[$operator], $match); |
|
| 93 | ||
| 94 | case self::MATCH_IS_MAIN_LOCATION: |
|
| 95 | case 'is_main': |
|
| @@ 104-110 (lines=7) @@ | ||
| 101 | return new Query\Criterion\Location\IsMainLocation(Query\Criterion\Location\IsMainLocation::NOT_MAIN); |
|
| 102 | } |
|
| 103 | ||
| 104 | case self::MATCH_PRIORITY: |
|
| 105 | $match = reset($values); |
|
| 106 | $operator = key($values); |
|
| 107 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 108 | throw new \Exception("Can not use '$operator' as comparison operator for depth"); |
|
| 109 | } |
|
| 110 | return new Query\Criterion\Location\Priority(self::$operatorsMap[$operator], $match); |
|
| 111 | } |
|
| 112 | ||
| 113 | return parent::getQueryCriterion($key, $values); |
|
| @@ 125-131 (lines=7) @@ | ||
| 122 | case self::MATCH_CONTENT_TYPE_IDENTIFIER: |
|
| 123 | return new Query\Criterion\ContentTypeIdentifier($values); |
|
| 124 | ||
| 125 | case self::MATCH_CREATION_DATE: |
|
| 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 dates"); |
|
| 130 | } |
|
| 131 | return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match); |
|
| 132 | ||
| 133 | case self::MATCH_GROUP: |
|
| 134 | foreach($values as &$value) { |
|
| @@ 141-147 (lines=7) @@ | ||
| 138 | } |
|
| 139 | return new Query\Criterion\UserMetadata(Query\Criterion\UserMetadata::GROUP, Operator::IN, $values); |
|
| 140 | ||
| 141 | case self::MATCH_MODIFICATION_DATE: |
|
| 142 | $match = reset($values); |
|
| 143 | $operator = key($values); |
|
| 144 | if (!isset(self::$operatorsMap[$operator])) { |
|
| 145 | throw new \Exception("Can not use '$operator' as comparison operator for dates"); |
|
| 146 | } |
|
| 147 | return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match); |
|
| 148 | ||
| 149 | case self::MATCH_OBJECT_STATE: |
|
| 150 | foreach($values as &$value) { |
|