@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | |
135 | 135 | $qb = $this->recordManager->find(strtolower((string) $parts[1])); |
136 | 136 | $qb->where($this->getName() . '_id = :id') |
137 | - ->setParameter('id', $this->__meta['id'], |
|
137 | + ->setParameter('id', $this->__meta['id'], |
|
138 | 138 | $this->determineIdType($this->__meta['id']) |
139 | - ); |
|
139 | + ); |
|
140 | 140 | |
141 | 141 | $result = $qb->get(); |
142 | 142 | |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | |
156 | 156 | $db = $this->recordManager->find($relTable); |
157 | 157 | $db->where($this->getName() . '_id = :id') |
158 | - ->setParameter('id', $this->__meta['id'], |
|
158 | + ->setParameter('id', $this->__meta['id'], |
|
159 | 159 | $this->determineIdType($this->__meta['id']) |
160 | - ); |
|
160 | + ); |
|
161 | 161 | |
162 | 162 | $relations = $db->get(); |
163 | 163 | $relIds = $this->extractRelationIds($relations, $targetTable); |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | |
169 | 169 | $db = $this->recordManager->find($targetTable); |
170 | 170 | $db->where('id IN (:ids)') |
171 | - ->setParameter('ids', $relIds, |
|
171 | + ->setParameter('ids', $relIds, |
|
172 | 172 | $this->determineIdsType($relIds) |
173 | - ); |
|
173 | + ); |
|
174 | 174 | |
175 | 175 | $result = $db->get(); |
176 | 176 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | $qb = $this->recordManager->find(strtolower((string) $parts[1])); |
136 | - $qb->where($this->getName() . '_id = :id') |
|
136 | + $qb->where($this->getName().'_id = :id') |
|
137 | 137 | ->setParameter('id', $this->__meta['id'], |
138 | 138 | $this->determineIdType($this->__meta['id']) |
139 | 139 | ); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $relTable = $this->getRelationTable($targetTable); |
155 | 155 | |
156 | 156 | $db = $this->recordManager->find($relTable); |
157 | - $db->where($this->getName() . '_id = :id') |
|
157 | + $db->where($this->getName().'_id = :id') |
|
158 | 158 | ->setParameter('id', $this->__meta['id'], |
159 | 159 | $this->determineIdType($this->__meta['id']) |
160 | 160 | ); |
@@ -180,15 +180,15 @@ discard block |
||
180 | 180 | |
181 | 181 | private function getRelationTable(string $targetTable): string |
182 | 182 | { |
183 | - return $this->tableManager->tableExists($this->table . '_' . $targetTable) |
|
184 | - ? $this->table . '_' . $targetTable |
|
185 | - : $targetTable . '_' . $this->table; |
|
183 | + return $this->tableManager->tableExists($this->table.'_'.$targetTable) |
|
184 | + ? $this->table.'_'.$targetTable |
|
185 | + : $targetTable.'_'.$this->table; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | private function extractRelationIds(Collection $relations, string $targetTable): array |
189 | 189 | { |
190 | - return $relations->map(function ($relation) use ($targetTable) { |
|
191 | - $key = $targetTable . '_id'; |
|
190 | + return $relations->map(function($relation) use ($targetTable) { |
|
191 | + $key = $targetTable.'_id'; |
|
192 | 192 | |
193 | 193 | return $relation->$key; |
194 | 194 | })->toArray(); |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | // Handle foreign key relations |
218 | - if (array_key_exists($key . '_id', $this->__properties['self'])) { |
|
219 | - $result = $this->recordManager->getById($key, $this->__properties['self'][$key . '_id']); |
|
218 | + if (array_key_exists($key.'_id', $this->__properties['self'])) { |
|
219 | + $result = $this->recordManager->getById($key, $this->__properties['self'][$key.'_id']); |
|
220 | 220 | $this->set($key, $result); |
221 | 221 | |
222 | 222 | return $result; |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | * |
387 | 387 | * @throws Exception\InvalidModelException |
388 | 388 | */ |
389 | - private function createCollection(?Collection $collection, array|Collection $models): Collection |
|
389 | + private function createCollection(?Collection $collection, array | Collection $models): Collection |
|
390 | 390 | { |
391 | 391 | if (is_null($collection)) { |
392 | 392 | $collection = Collection::fromIterable([]); |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | |
418 | 418 | private function handleModelRelation(string $key, Model $val): void |
419 | 419 | { |
420 | - if (isset($this->__properties['all'][$key . '_id'])) { |
|
421 | - unset($this->__properties['all'][$key . '_id']); |
|
420 | + if (isset($this->__properties['all'][$key.'_id'])) { |
|
421 | + unset($this->__properties['all'][$key.'_id']); |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | $this->__meta['foreign_models']['oto'] = $this->createCollection( |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | /** |
468 | 468 | * Determines the ParameterType for an ID value |
469 | 469 | */ |
470 | - private function determineIdType(int|string $id): ParameterType |
|
470 | + private function determineIdType(int | string $id): ParameterType |
|
471 | 471 | { |
472 | 472 | return is_int($id) ? ParameterType::INTEGER : ParameterType::STRING; |
473 | 473 | } |