@@ -62,8 +62,7 @@ |
||
62 | 62 | assert(is_scalar($index) === true && is_scalar($type) === true); |
63 | 63 | $expectedType = $context->getProperties()->getProperty(static::PROPERTY_RESOURCE_TYPE); |
64 | 64 | $reply = $type === $expectedType ? |
65 | - static::createSuccessReply($index) : |
|
66 | - static::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
65 | + static::createSuccessReply($index) : static::createErrorReply($context, $type, ErrorCodes::INVALID_RELATIONSHIP_TYPE); |
|
67 | 66 | |
68 | 67 | return $reply; |
69 | 68 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | private $serializedRules = []; |
36 | 36 | |
37 | 37 | /** Index key */ |
38 | - protected const IDENTITY_RULE= 0; |
|
38 | + protected const IDENTITY_RULE = 0; |
|
39 | 39 | |
40 | 40 | /** Index key */ |
41 | 41 | protected const FILTER_RULES = self::IDENTITY_RULE + 1; |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | $modelClass = $schemaClass::MODEL; |
650 | 650 | assert($schemaInfo->hasRelationship($modelClass, $modelRelName)); |
651 | 651 | assert( |
652 | - ($type =$schemaInfo->getRelationshipType($modelClass, $modelRelName)) === RelationshipTypes::BELONGS_TO || |
|
652 | + ($type = $schemaInfo->getRelationshipType($modelClass, $modelRelName)) === RelationshipTypes::BELONGS_TO || |
|
653 | 653 | $type === RelationshipTypes::BELONGS_TO_MANY |
654 | 654 | ); |
655 | 655 | |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | */ |
905 | 905 | private static function assertClassValueDefined(?string $value): void |
906 | 906 | { |
907 | - assert(empty($value) === false, 'Value should be defined in `' . static::class . '`.'); |
|
907 | + assert(empty($value) === false, 'Value should be defined in `'.static::class.'`.'); |
|
908 | 908 | } |
909 | 909 | |
910 | 910 | /** |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | { |
918 | 918 | assert( |
919 | 919 | array_key_exists($interface, class_implements($class)) === true, |
920 | - "Class `$class` should implement `" . $interface . '` interface.' |
|
920 | + "Class `$class` should implement `".$interface.'` interface.' |
|
921 | 921 | ); |
922 | 922 | } |
923 | 923 | } |
@@ -212,12 +212,12 @@ |
||
212 | 212 | return [static::DATA => $data->getData()]; |
213 | 213 | } |
214 | 214 | |
215 | - $buildUrl = function ($offset) use ($data, $uri) { |
|
215 | + $buildUrl = function($offset) use ($data, $uri) { |
|
216 | 216 | $paramsWithPaging = [ |
217 | 217 | JsonApiQueryParserInterface::PARAM_PAGING_OFFSET => $offset, |
218 | 218 | JsonApiQueryParserInterface::PARAM_PAGING_LIMIT => $data->getLimit(), |
219 | 219 | ]; |
220 | - $fullUrl = $uri . '?' . http_build_query($paramsWithPaging); |
|
220 | + $fullUrl = $uri.'?'.http_build_query($paramsWithPaging); |
|
221 | 221 | |
222 | 222 | return $fullUrl; |
223 | 223 | }; |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | assert(class_exists($controllerClass) === true); |
49 | 49 | |
50 | 50 | $groupPrefix = $group->getUriPrefix(); |
51 | - $indexSlug = '/{' . JCI::ROUTE_KEY_INDEX . '}'; |
|
52 | - $params = function (string $method) use ($groupPrefix, $resourceName): array { |
|
51 | + $indexSlug = '/{'.JCI::ROUTE_KEY_INDEX.'}'; |
|
52 | + $params = function(string $method) use ($groupPrefix, $resourceName): array { |
|
53 | 53 | return [RouteInterface::PARAM_NAME => static::routeName($groupPrefix, $resourceName, $method)]; |
54 | 54 | }; |
55 | - $handler = function (string $method) use ($controllerClass): array { |
|
55 | + $handler = function(string $method) use ($controllerClass): array { |
|
56 | 56 | return [$controllerClass, $method]; |
57 | 57 | }; |
58 | 58 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $group->post($resourceName, $handler(JCI::METHOD_CREATE), $params(JCI::METHOD_CREATE)); |
66 | 66 | } |
67 | 67 | if (in_array(ControllerReadInterface::class, $classInterfaces) === true) { |
68 | - $group->get($resourceName . $indexSlug, $handler(JCI::METHOD_READ), $params(JCI::METHOD_READ)); |
|
68 | + $group->get($resourceName.$indexSlug, $handler(JCI::METHOD_READ), $params(JCI::METHOD_READ)); |
|
69 | 69 | } |
70 | 70 | if (in_array(ControllerUpdateInterface::class, $classInterfaces) === true) { |
71 | - $group->patch($resourceName . $indexSlug, $handler(JCI::METHOD_UPDATE), $params(JCI::METHOD_UPDATE)); |
|
71 | + $group->patch($resourceName.$indexSlug, $handler(JCI::METHOD_UPDATE), $params(JCI::METHOD_UPDATE)); |
|
72 | 72 | } |
73 | 73 | if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) { |
74 | - $group->delete($resourceName . $indexSlug, $handler(JCI::METHOD_DELETE), $params(JCI::METHOD_DELETE)); |
|
74 | + $group->delete($resourceName.$indexSlug, $handler(JCI::METHOD_DELETE), $params(JCI::METHOD_DELETE)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $group; |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $groupPrefix = $group->getUriPrefix(); |
100 | - $slugged = $subUri . '/{' . FCI::ROUTE_KEY_INDEX . '}'; |
|
101 | - $params = function (string $method) use ($groupPrefix, $subUri) : array { |
|
100 | + $slugged = $subUri.'/{'.FCI::ROUTE_KEY_INDEX.'}'; |
|
101 | + $params = function(string $method) use ($groupPrefix, $subUri) : array { |
|
102 | 102 | return [RouteInterface::PARAM_NAME => static::routeName($groupPrefix, $subUri, $method)]; |
103 | 103 | }; |
104 | - $handler = function (string $method) use ($controllerClass): array { |
|
104 | + $handler = function(string $method) use ($controllerClass): array { |
|
105 | 105 | return [$controllerClass, $method]; |
106 | 106 | }; |
107 | 107 | |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | $group->get($subUri, $handler(FCI::METHOD_INDEX), $params(FCI::METHOD_INDEX)); |
113 | 113 | } |
114 | 114 | if (in_array(ControllerInstanceInterface::class, $classInterfaces) === true) { |
115 | - $group->get($subUri . $createSubUrl, $handler(FCI::METHOD_INSTANCE), $params(FCI::METHOD_INSTANCE)); |
|
115 | + $group->get($subUri.$createSubUrl, $handler(FCI::METHOD_INSTANCE), $params(FCI::METHOD_INSTANCE)); |
|
116 | 116 | } |
117 | 117 | if (in_array(ControllerCreateInterface::class, $classInterfaces) === true) { |
118 | - $group->post($subUri . $createSubUrl, $handler(FCI::METHOD_CREATE), $params(FCI::METHOD_CREATE)); |
|
118 | + $group->post($subUri.$createSubUrl, $handler(FCI::METHOD_CREATE), $params(FCI::METHOD_CREATE)); |
|
119 | 119 | } |
120 | 120 | if (in_array(ControllerReadInterface::class, $classInterfaces) === true) { |
121 | 121 | $group->get($slugged, $handler(FCI::METHOD_READ), $params(FCI::METHOD_READ)); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $group->post($slugged, $handler(FCI::METHOD_UPDATE), $params(FCI::METHOD_UPDATE)); |
125 | 125 | } |
126 | 126 | if (in_array(ControllerDeleteInterface::class, $classInterfaces) === true) { |
127 | - $deleteUri = $slugged . '/' . FCI::METHOD_DELETE; |
|
127 | + $deleteUri = $slugged.'/'.FCI::METHOD_DELETE; |
|
128 | 128 | $group->post($deleteUri, $handler(FCI::METHOD_DELETE), $params(FCI::METHOD_DELETE)); |
129 | 129 | } |
130 | 130 | |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | string $controllerClass, |
148 | 148 | string $selfGetMethod |
149 | 149 | ): GroupInterface { |
150 | - $resourceIdUri = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/'; |
|
151 | - $selfUri = $resourceIdUri . DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName; |
|
150 | + $resourceIdUri = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/'; |
|
151 | + $selfUri = $resourceIdUri.DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName; |
|
152 | 152 | |
153 | 153 | return $group |
154 | 154 | // `self` |
155 | 155 | ->get($selfUri, [$controllerClass, $selfGetMethod]) |
156 | 156 | // `related` |
157 | - ->get($resourceIdUri . $relationshipName, [$controllerClass, $selfGetMethod]); |
|
157 | + ->get($resourceIdUri.$relationshipName, [$controllerClass, $selfGetMethod]); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | string $controllerClass, |
174 | 174 | string $addMethod |
175 | 175 | ): GroupInterface { |
176 | - $url = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/' . |
|
177 | - DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName; |
|
176 | + $url = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/'. |
|
177 | + DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName; |
|
178 | 178 | |
179 | 179 | return $group->post($url, [$controllerClass, $addMethod]); |
180 | 180 | } |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | string $controllerClass, |
196 | 196 | string $deleteMethod |
197 | 197 | ): GroupInterface { |
198 | - $url = $resourceName . '/{' . JCI::ROUTE_KEY_INDEX . '}/' . |
|
199 | - DocumentInterface::KEYWORD_RELATIONSHIPS . '/' . $relationshipName; |
|
198 | + $url = $resourceName.'/{'.JCI::ROUTE_KEY_INDEX.'}/'. |
|
199 | + DocumentInterface::KEYWORD_RELATIONSHIPS.'/'.$relationshipName; |
|
200 | 200 | |
201 | 201 | return $group->delete($url, [$controllerClass, $deleteMethod]); |
202 | 202 | } |
@@ -222,6 +222,6 @@ discard block |
||
222 | 222 | $subUri = substr($subUri, 0, -1); |
223 | 223 | } |
224 | 224 | |
225 | - return $prefix . $subUri . '::' . $method; |
|
225 | + return $prefix.$subUri.'::'.$method; |
|
226 | 226 | } |
227 | 227 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | parse_str($this->getOriginalUri()->getQuery(), $queryParams); |
127 | 127 | |
128 | - return function ($offset) use ($pageSize, $queryParams) { |
|
128 | + return function($offset) use ($pageSize, $queryParams) { |
|
129 | 129 | $paramsWithPaging = array_merge($queryParams, [ |
130 | 130 | BaseQueryParserInterface::PARAM_PAGE => [ |
131 | 131 | JsonApiQueryParserInterface::PARAM_PAGING_OFFSET => $offset, |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ], |
134 | 134 | ]); |
135 | 135 | $newUri = $this->getOriginalUri()->withQuery(http_build_query($paramsWithPaging)); |
136 | - $fullUrl = (string)$newUri; |
|
136 | + $fullUrl = (string) $newUri; |
|
137 | 137 | $link = $this->getFactory()->createLink($fullUrl, null, true); |
138 | 138 | |
139 | 139 | return $link; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | throw new InvalidArgumentException($this->getMessage(Messages::MSG_ERR_INVALID_ARGUMENT)); |
213 | 213 | } |
214 | 214 | |
215 | - assert(call_user_func(function () use ($indexes) { |
|
215 | + assert(call_user_func(function() use ($indexes) { |
|
216 | 216 | $allOk = true; |
217 | 217 | |
218 | 218 | foreach ($indexes as $index) { |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $classAtPath = new ArrayObject(); |
765 | 765 | $idsAtPath = new ArrayObject(); |
766 | 766 | |
767 | - $registerModelAtRoot = function ($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
767 | + $registerModelAtRoot = function($model) use ($modelStorage, $modelsAtPath, $idsAtPath): void { |
|
768 | 768 | self::registerModelAtPath( |
769 | 769 | $model, |
770 | 770 | static::ROOT_PATH, |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | assert(is_string($pathPiece)); |
853 | 853 | $parent = $tmpPath; |
854 | 854 | $tmpPath = empty($tmpPath) === true ? |
855 | - $pathPiece : $tmpPath . static::PATH_SEPARATOR . $pathPiece; |
|
855 | + $pathPiece : $tmpPath.static::PATH_SEPARATOR.$pathPiece; |
|
856 | 856 | $normalizedPaths[$tmpPath] = [$parent, $pathPiece]; |
857 | 857 | $pathsDepths[$parent] = $parentDepth++; |
858 | 858 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | ): ModelQueryBuilder { |
1022 | 1022 | assert( |
1023 | 1023 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $relationshipName), |
1024 | - "Relationship `$relationshipName` do not exist in model `" . $this->getModelClass() . '`' |
|
1024 | + "Relationship `$relationshipName` do not exist in model `".$this->getModelClass().'`' |
|
1025 | 1025 | ); |
1026 | 1026 | |
1027 | 1027 | // as we read data from a relationship our main table and model would be the table/model in the relationship |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | if ($this->hasFilters() === true) { |
1040 | 1040 | $filters = $this->getFilters(); |
1041 | 1041 | $sorts = $this->getSorts(); |
1042 | - $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder::AND : ModelQueryBuilder::OR; |
|
1042 | + $joinCondition = $this->areFiltersWithAnd() === true ? ModelQueryBuilder:: AND : ModelQueryBuilder:: OR ; |
|
1043 | 1043 | $builder->addRelationshipFiltersAndSorts($reverseRelName, $filters, $sorts, $joinCondition); |
1044 | 1044 | } |
1045 | 1045 | // ... and the input filters to actual data we select |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | ) { |
1071 | 1071 | assert( |
1072 | 1072 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1073 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1073 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1074 | 1074 | ); |
1075 | 1075 | |
1076 | 1076 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | ): array { |
1100 | 1100 | assert( |
1101 | 1101 | $this->getModelSchemas()->hasRelationship($this->getModelClass(), $name), |
1102 | - "Relationship `$name` do not exist in model `" . $this->getModelClass() . '`' |
|
1102 | + "Relationship `$name` do not exist in model `".$this->getModelClass().'`' |
|
1103 | 1103 | ); |
1104 | 1104 | |
1105 | 1105 | // depending on the relationship type we expect the result to be either single resource or a collection |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | $this->clearFetchParameters(); |
1177 | 1177 | |
1178 | - return (int)$deleted; |
|
1178 | + return (int) $deleted; |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | /** |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | $this->clearFetchParameters(); |
1193 | 1193 | |
1194 | - return (int)$deleted > 0; |
|
1194 | + return (int) $deleted > 0; |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | /** |
@@ -1216,7 +1216,7 @@ discard block |
||
1216 | 1216 | |
1217 | 1217 | $this->clearBuilderParameters()->clearFetchParameters(); |
1218 | 1218 | |
1219 | - $this->inTransaction(function () use ($saveMain, $toMany, &$index) { |
|
1219 | + $this->inTransaction(function() use ($saveMain, $toMany, &$index) { |
|
1220 | 1220 | $saveMain->execute(); |
1221 | 1221 | |
1222 | 1222 | // if no index given will use last insert ID as index |
@@ -1257,12 +1257,12 @@ discard block |
||
1257 | 1257 | ->createBuilder($this->getModelClass()) |
1258 | 1258 | ->updateModels($allowedChanges) |
1259 | 1259 | ->addFiltersWithAndToTable($filters); |
1260 | - $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1260 | + $saveMain = $this->builderSaveResourceOnUpdate($saveMain); |
|
1261 | 1261 | $saveMain->getSQL(); // prepare |
1262 | 1262 | |
1263 | 1263 | $this->clearBuilderParameters()->clearFetchParameters(); |
1264 | 1264 | |
1265 | - $this->inTransaction(function () use ($saveMain, $toMany, $index, &$updated) { |
|
1265 | + $this->inTransaction(function() use ($saveMain, $toMany, $index, &$updated) { |
|
1266 | 1266 | $updated = $saveMain->execute(); |
1267 | 1267 | |
1268 | 1268 | $builderHook = Closure::fromCallable([$this, 'builderSaveRelationshipOnUpdate']); |
@@ -1278,7 +1278,7 @@ discard block |
||
1278 | 1278 | )->execute(); |
1279 | 1279 | |
1280 | 1280 | // add new ones |
1281 | - $updated += $this->addInToManyRelationship( |
|
1281 | + $updated += $this->addInToManyRelationship( |
|
1282 | 1282 | $connection, |
1283 | 1283 | $index, |
1284 | 1284 | $relationshipName, |
@@ -1288,7 +1288,7 @@ discard block |
||
1288 | 1288 | } |
1289 | 1289 | }); |
1290 | 1290 | |
1291 | - return (int)$updated; |
|
1291 | + return (int) $updated; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | /** |
@@ -1303,9 +1303,9 @@ discard block |
||
1303 | 1303 | public function createInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1304 | 1304 | { |
1305 | 1305 | // Check that relationship is `BelongsToMany` |
1306 | - assert(call_user_func(function () use ($name): bool { |
|
1306 | + assert(call_user_func(function() use ($name): bool { |
|
1307 | 1307 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1308 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1308 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1309 | 1309 | '` either is not `belongsToMany` or do not exist in the class.'; |
1310 | 1310 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1311 | 1311 | |
@@ -1327,9 +1327,9 @@ discard block |
||
1327 | 1327 | public function removeInBelongsToManyRelationship(string $parentId, string $name, iterable $childIds): int |
1328 | 1328 | { |
1329 | 1329 | // Check that relationship is `BelongsToMany` |
1330 | - assert(call_user_func(function () use ($name): bool { |
|
1330 | + assert(call_user_func(function() use ($name): bool { |
|
1331 | 1331 | $relType = $this->getModelSchemas()->getRelationshipType($this->getModelClass(), $name); |
1332 | - $errMsg = "Relationship `$name` of class `" . $this->getModelClass() . |
|
1332 | + $errMsg = "Relationship `$name` of class `".$this->getModelClass(). |
|
1333 | 1333 | '` either is not `belongsToMany` or do not exist in the class.'; |
1334 | 1334 | $isOk = $relType === RelationshipTypes::BELONGS_TO_MANY; |
1335 | 1335 | |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | { |
1498 | 1498 | $countBuilder = $this->createBuilder($this->getModelClass()); |
1499 | 1499 | $countBuilder->setParameters($builder->getParameters()); |
1500 | - $countBuilder->select('COUNT(*)')->from('(' . $builder->getSQL() . ') AS RESULT'); |
|
1500 | + $countBuilder->select('COUNT(*)')->from('('.$builder->getSQL().') AS RESULT'); |
|
1501 | 1501 | |
1502 | 1502 | return $countBuilder; |
1503 | 1503 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | |
1530 | 1530 | foreach ($secondaryIdentities as $secondaryId) { |
1531 | 1531 | try { |
1532 | - $inserted += (int)$saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1532 | + $inserted += (int) $saveToMany->setParameter($secondaryIdBindName, $secondaryId)->execute(); |
|
1533 | 1533 | } /** @noinspection PhpRedundantCatchClauseInspection */ catch (UcvException $exception) { |
1534 | 1534 | // Spec: If all of the specified resources can be added to, or are already present in, |
1535 | 1535 | // the relationship then the server MUST return a successful response. |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | |
1777 | 1777 | $pkName = $this->getModelSchemas()->getPrimaryKey($parentClass); |
1778 | 1778 | |
1779 | - $registerModelAtPath = function ($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1779 | + $registerModelAtPath = function($model, string $path) use ($deDup, $modelsAtPath, $idsAtPath) { |
|
1780 | 1780 | return self::registerModelAtPath( |
1781 | 1781 | $model, |
1782 | 1782 | $path, |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | }; |
1789 | 1789 | |
1790 | 1790 | foreach ($childRelationships as $name) { |
1791 | - $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath . static::PATH_SEPARATOR . $name : $name; |
|
1791 | + $childrenPath = $parentsPath !== static::ROOT_PATH ? $parentsPath.static::PATH_SEPARATOR.$name : $name; |
|
1792 | 1792 | |
1793 | 1793 | $relationshipType = $this->getModelSchemas()->getRelationshipType($parentClass, $name); |
1794 | 1794 | list ($targetModelClass, $reverseRelName) = |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | [$pkName => [FilterParameterInterface::OPERATION_EQUALS => [$parent->{$pkName}]]], |
1844 | 1844 | [] |
1845 | 1845 | ); |
1846 | - $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1846 | + $children = $this->fetchPaginatedResourcesWithoutRelationships( |
|
1847 | 1847 | $clonedBuilder, |
1848 | 1848 | $clonedBuilder->getModelClass() |
1849 | 1849 | ); |
@@ -82,7 +82,6 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | return $result === true ? |
85 | - static::createSuccessReply($values) : |
|
86 | - static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
85 | + static::createSuccessReply($values) : static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
87 | 86 | } |
88 | 87 | } |
@@ -83,13 +83,12 @@ |
||
83 | 83 | ->where($builder->expr()->in($primaryName, $placeholders)) |
84 | 84 | ->execute(); |
85 | 85 | |
86 | - $count = (int)$statement->fetchColumn(); |
|
86 | + $count = (int) $statement->fetchColumn(); |
|
87 | 87 | $result = $count === count($values); |
88 | 88 | } |
89 | 89 | |
90 | 90 | $reply = $result === true ? |
91 | - static::createSuccessReply($values) : |
|
92 | - static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
91 | + static::createSuccessReply($values) : static::createErrorReply($context, $values, ErrorCodes::EXIST_IN_DATABASE_MULTIPLE); |
|
93 | 92 | |
94 | 93 | return $reply; |
95 | 94 | } |