@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | $connection = $this->manager->getConnection(); |
231 | - $id = $connection->transaction(function (Connection $connection) use ($data, $mapper) { |
|
231 | + $id = $connection->transaction(function(Connection $connection) use ($data, $mapper) { |
|
232 | 232 | $columns = $data->getRawColumns(); |
233 | 233 | $pkGenerator = $mapper->getPrimaryKeyGenerator(); |
234 | 234 | if ($pkGenerator !== null) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $modified = $data->getModifiedColumns(); |
299 | 299 | if (!empty($modified)) { |
300 | 300 | $connection = $this->manager->getConnection(); |
301 | - $result = $connection->transaction(function (Connection $connection) use ($data, $mapper, $modified) { |
|
301 | + $result = $connection->transaction(function(Connection $connection) use ($data, $mapper, $modified) { |
|
302 | 302 | $columns = array_intersect_key($data->getRawColumns(), array_flip($modified)); |
303 | 303 | |
304 | 304 | $updatedAt = null; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | $connection = $this->manager->getConnection(); |
338 | - return $connection->transaction(function (Connection $connection) use ($data) { |
|
338 | + return $connection->transaction(function(Connection $connection) use ($data) { |
|
339 | 339 | $data->executePendingLinkage(); |
340 | 340 | |
341 | 341 | return true; |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $eventsHandlers = $mapper->getEventHandlers(); |
353 | 353 | $connection = $this->manager->getConnection(); |
354 | 354 | |
355 | - $result = $connection->transaction(function () use ($data, $mapper, $force) { |
|
355 | + $result = $connection->transaction(function() use ($data, $mapper, $force) { |
|
356 | 356 | if ($data->isDeleted()) { |
357 | 357 | throw new EntityStateException('The record was deleted'); |
358 | 358 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function delete(bool $force = false, array $tables = []): int |
202 | 202 | { |
203 | - return (int) $this->transaction(function (Connection $connection) use ($tables, $force) { |
|
203 | + return (int) $this->transaction(function(Connection $connection) use ($tables, $force) { |
|
204 | 204 | if (!$force && $this->mapper->hasSoftDelete()) { |
205 | 205 | return (new Update($connection, $this->mapper->getTable(), $this->queryStatement)) |
206 | 206 | ->set([ |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function update(array $columns = []): int |
220 | 220 | { |
221 | - return (int) $this->transaction(function (Connection $connection) use ($columns) { |
|
221 | + return (int) $this->transaction(function(Connection $connection) use ($columns) { |
|
222 | 222 | if ($this->mapper->hasTimestamp()) { |
223 | 223 | list(, $updatedAtColumn) = $this->mapper->getTimestampColumns(); |
224 | 224 | $columns[$updatedAtColumn] = date($this->manager->getDateFormat()); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function increment($column, $value = 1): int |
238 | 238 | { |
239 | - return (int) $this->transaction(function (Connection $connection) use ($column, $value) { |
|
239 | + return (int) $this->transaction(function(Connection $connection) use ($column, $value) { |
|
240 | 240 | if ($this->mapper->hasTimestamp()) { |
241 | 241 | list(, $updatedAtColumn) = $this->mapper->getTimestampColumns(); |
242 | 242 | $this->queryStatement->addUpdateColumns([ |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function decrement($column, $value = 1): int |
258 | 258 | { |
259 | - return (int) $this->transaction(function (Connection $connection) use ($column, $value) { |
|
259 | + return (int) $this->transaction(function(Connection $connection) use ($column, $value) { |
|
260 | 260 | if ($this->mapper->hasTimestamp()) { |
261 | 261 | list(, $updatedAtColumn) = $this->mapper->getTimestampColumns(); |
262 | 262 | $this->queryStatement->addUpdateColumns([ |
@@ -311,7 +311,7 @@ |
||
311 | 311 | */ |
312 | 312 | public function relation(string $name): RelationFactory |
313 | 313 | { |
314 | - return new RelationFactory($name, function ($name, Relation $relation) { |
|
314 | + return new RelationFactory($name, function($name, Relation $relation) { |
|
315 | 315 | return $this->relations[$name] = $relation; |
316 | 316 | }); |
317 | 317 | } |
@@ -259,7 +259,7 @@ |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | $primaryKey = $this->mapper->getPrimaryKey(); |
262 | - if ($name === (string)$primaryKey) { |
|
262 | + if ($name === (string) $primaryKey) { |
|
263 | 263 | return $this->columns[$name] = $value; |
264 | 264 | } |
265 | 265 |
@@ -260,11 +260,11 @@ discard block |
||
260 | 260 | } |
261 | 261 | }; |
262 | 262 | |
263 | - $linkKey = new ForeignKey(array_map(function ($value) use ($junctionTable) { |
|
263 | + $linkKey = new ForeignKey(array_map(function($value) use ($junctionTable) { |
|
264 | 264 | return 'hidden_' . $junctionTable . $value; |
265 | 265 | }, $this->foreignKey->columns())); |
266 | 266 | |
267 | - $select->join($joinTable, function (Join $join) use ($junctionTable, $joinTable) { |
|
267 | + $select->join($joinTable, function(Join $join) use ($junctionTable, $joinTable) { |
|
268 | 268 | if ($this->junction !== null) { |
269 | 269 | foreach ($this->junction->columns() as $pkColumn => $fkColumn) { |
270 | 270 | $join->on($junctionTable . '.' . $fkColumn, $joinTable . '.' . $pkColumn); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | }; |
372 | 372 | |
373 | - $select->join($joinTable, function (Join $join) use ($junctionTable, $joinTable) { |
|
373 | + $select->join($joinTable, function(Join $join) use ($junctionTable, $joinTable) { |
|
374 | 374 | if ($this->junction !== null) { |
375 | 375 | foreach ($this->junction->columns() as $pkColumn => $fkColumn) { |
376 | 376 | $join->on($junctionTable . '.' . $fkColumn, $joinTable . '.' . $pkColumn); |
@@ -110,7 +110,7 @@ |
||
110 | 110 | foreach ($rawColumns as $name => $value) { |
111 | 111 | if ($this->mapper()->hasRelation($name)) { |
112 | 112 | $relation = $this->mapper()->getRelated($name); |
113 | - if($relation instanceof self){ |
|
113 | + if ($relation instanceof self) { |
|
114 | 114 | $data[$name] = $relation->jsonSerialize(); |
115 | 115 | } else { |
116 | 116 | $data[$name] = $relation; |