@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param int $limit The number of Models to limit. |
| 84 | 84 | * @return \Doctrine\MongoDB\Cursor |
| 85 | 85 | */ |
| 86 | - public function executeFind(EntityMetadata $metadata, Store $store, array $criteria, array $fields = [], array $sort = [], $offset = 0, $limit = 0) |
|
| 86 | + public function executeFind(EntityMetadata $metadata, Store $store, array $criteria, array $fields = [ ], array $sort = [ ], $offset = 0, $limit = 0) |
|
| 87 | 87 | { |
| 88 | 88 | $criteria = $this->getFormatter()->formatQuery($metadata, $store, $criteria); |
| 89 | 89 | |
@@ -162,14 +162,14 @@ discard block |
||
| 162 | 162 | ]; |
| 163 | 163 | if (true === $owner->isChildEntity()) { |
| 164 | 164 | // The owner is owned by a polymorphic model. Must include the type with the inverse field criteria. |
| 165 | - $criteria[$inverseField] = [ |
|
| 166 | - Persister::IDENTIFIER_KEY => $criteria[$inverseField], |
|
| 165 | + $criteria[ $inverseField ] = [ |
|
| 166 | + Persister::IDENTIFIER_KEY => $criteria[ $inverseField ], |
|
| 167 | 167 | Persister::POLYMORPHIC_KEY => $owner->type, |
| 168 | 168 | ]; |
| 169 | 169 | } |
| 170 | 170 | if (true === $related->isChildEntity()) { |
| 171 | 171 | // The relationship is owned by a polymorphic model. Must include the type in the root criteria. |
| 172 | - $criteria[Persister::POLYMORPHIC_KEY] = $related->type; |
|
| 172 | + $criteria[ Persister::POLYMORPHIC_KEY ] = $related->type; |
|
| 173 | 173 | } |
| 174 | 174 | return $criteria; |
| 175 | 175 | } |
@@ -197,16 +197,16 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function getRetrieveCritiera(EntityMetadata $metadata, $identifiers = null) |
| 199 | 199 | { |
| 200 | - $criteria = []; |
|
| 200 | + $criteria = [ ]; |
|
| 201 | 201 | if (true === $metadata->isChildEntity()) { |
| 202 | - $criteria[Persister::POLYMORPHIC_KEY] = $metadata->type; |
|
| 202 | + $criteria[ Persister::POLYMORPHIC_KEY ] = $metadata->type; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $identifiers = (array) $identifiers; |
| 206 | 206 | if (empty($identifiers)) { |
| 207 | 207 | return $criteria; |
| 208 | 208 | } |
| 209 | - $criteria[Persister::IDENTIFIER_KEY] = (1 === count($identifiers)) ? reset($identifiers) : $identifiers; |
|
| 209 | + $criteria[ Persister::IDENTIFIER_KEY ] = (1 === count($identifiers)) ? reset($identifiers) : $identifiers; |
|
| 210 | 210 | return $criteria; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | private function isSearchQuery(array $criteria) |
| 292 | 292 | { |
| 293 | - if (isset($criteria['$text'])) { |
|
| 293 | + if (isset($criteria[ '$text' ])) { |
|
| 294 | 294 | return true; |
| 295 | 295 | } |
| 296 | 296 | foreach ($criteria as $key => $value) { |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | if ($type !== $include) { |
| 320 | 320 | PersisterException::badRequest('Field projection mismatch. You cannot both exclude and include fields.'); |
| 321 | 321 | } |
| 322 | - $fields[$key] = $type; |
|
| 322 | + $fields[ $key ] = $type; |
|
| 323 | 323 | } |
| 324 | - return [$fields, $include]; |
|
| 324 | + return [ $fields, $include ]; |
|
| 325 | 325 | } |
| 326 | 326 | } |