@@ -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 | |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | }; |
| 263 | 263 | |
| 264 | - $linkKey = new ForeignKey(array_map(function ($value) use ($junctionTable) { |
|
| 264 | + $linkKey = new ForeignKey(array_map(function($value) use ($junctionTable) { |
|
| 265 | 265 | return 'hidden_' . $junctionTable . $value; |
| 266 | 266 | }, $this->foreignKey->columns())); |
| 267 | 267 | |
| 268 | - $select->join($joinTable, function (Join $join) use ($junctionTable, $joinTable) { |
|
| 268 | + $select->join($joinTable, function(Join $join) use ($junctionTable, $joinTable) { |
|
| 269 | 269 | foreach ($this->junction->columns() as $pkColumn => $fkColumn) { |
| 270 | 270 | $join->on($junctionTable . '.' . $fkColumn, $joinTable . '.' . $pkColumn); |
| 271 | 271 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | }; |
| 371 | 371 | |
| 372 | - $select->join($joinTable, function (Join $join) use ($junctionTable, $joinTable) { |
|
| 372 | + $select->join($joinTable, function(Join $join) use ($junctionTable, $joinTable) { |
|
| 373 | 373 | foreach ($this->junction->columns() as $pkColumn => $fkColumn) { |
| 374 | 374 | $join->on($junctionTable . '.' . $fkColumn, $joinTable . '.' . $pkColumn); |
| 375 | 375 | } |