@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $con = NOSQLParserTrait::initConnection($model, $con); |
23 | 23 | $collection = $con->selectCollection($model->getSchema()->name); |
24 | 24 | $result = $collection->findOne(['_id' => new ObjectId($pk)]); |
25 | - if(null !== $result) { |
|
25 | + if (null !== $result) { |
|
26 | 26 | $model->feed($result->getArrayCopy()); |
27 | 27 | } else { |
28 | 28 | throw new ApiException(t('Document not found'), 404); |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | $filters = self::parseCriteria($criteria, $model); |
49 | 49 | //$resultSet->count = $collection->countDocuments($filters); |
50 | 50 | $nosqlOptions = [ |
51 | - 'limit' => (integer)(array_key_exists(Api::API_LIMIT_FIELD, $criteria) ? $criteria[Api::API_LIMIT_FIELD] : Config::getParam('pagination.limit', 50)), |
|
52 | - 'skip' => (integer)(array_key_exists(Api::API_PAGE_FIELD, $criteria) ? $criteria[Api::API_PAGE_FIELD] : 1) |
|
51 | + 'limit' => (integer) (array_key_exists(Api::API_LIMIT_FIELD, $criteria) ? $criteria[Api::API_LIMIT_FIELD] : Config::getParam('pagination.limit', 50)), |
|
52 | + 'skip' => (integer) (array_key_exists(Api::API_PAGE_FIELD, $criteria) ? $criteria[Api::API_PAGE_FIELD] : 1) |
|
53 | 53 | ]; |
54 | 54 | $results = $collection->find($filters, $nosqlOptions); |
55 | 55 | /** @var $result */ |
56 | 56 | $items = $results->toArray(); |
57 | - foreach($items as $item) { |
|
57 | + foreach ($items as $item) { |
|
58 | 58 | $model->feed($item->getArrayCopy(), true); |
59 | 59 | $resultSet->items[] = $model->getDtoCopy(true); |
60 | 60 | } |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | break; |
109 | 109 | } |
110 | 110 | } elseif (NOSQLBase::NOSQL_TYPE_INTEGER === $property->type) { |
111 | - $filterValue = (integer)$filterValue; |
|
111 | + $filterValue = (integer) $filterValue; |
|
112 | 112 | } else { |
113 | - $filterValue = (float)$filterValue; |
|
113 | + $filterValue = (float) $filterValue; |
|
114 | 114 | } |
115 | 115 | $filterValue = [ |
116 | 116 | '$eq' => $filterValue, |