@@ -107,7 +107,7 @@ |
||
| 107 | 107 | return null; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - return $this->entities[$class . '.' . $identity]; |
|
| 110 | + return $this->entities[$class.'.'.$identity]; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @param string|int $id Primary key value. |
| 97 | 97 | * |
| 98 | - * @return EntityInterface|Record|null |
|
| 98 | + * @return null|\Spiral\ORM\RecordInterface |
|
| 99 | 99 | */ |
| 100 | 100 | public function findByPK($id) |
| 101 | 101 | { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param array $query Fields and conditions to query by. |
| 109 | 109 | * @param array $sortBy Always specify sort by to ensure that results are stable. |
| 110 | 110 | * |
| 111 | - * @return EntityInterface|Record|null |
|
| 111 | + * @return null|\Spiral\ORM\RecordInterface |
|
| 112 | 112 | */ |
| 113 | 113 | public function findOne(array $query = [], array $sortBy = []) |
| 114 | 114 | { |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | * @param bool $changedEntities Reference, will be set to true if any of entities changed |
| 260 | 260 | * internally. |
| 261 | 261 | */ |
| 262 | - public function hasChanges(bool &$changedEntities = null): bool |
|
| 262 | + public function hasChanges(bool & $changedEntities = null): bool |
|
| 263 | 263 | { |
| 264 | 264 | foreach ($this->entities as $entity) { |
| 265 | 265 | if ($entity->hasChanges()) { |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | $atomics = array_merge( |
| 328 | 328 | $atomics, |
| 329 | - $entity->buildAtomics((!empty($container) ? $container . '.' : '') . $offset) |
|
| 329 | + $entity->buildAtomics((!empty($container) ? $container.'.' : '').$offset) |
|
| 330 | 330 | ); |
| 331 | 331 | } |
| 332 | 332 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public function primaryKey(): string |
| 80 | 80 | { |
| 81 | - return $this->getAlias() . '.' . $this->schema[Record::SH_PRIMARY_KEY]; |
|
| 81 | + return $this->getAlias().'.'.$this->schema[Record::SH_PRIMARY_KEY]; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @see Record::INDEXES |
| 101 | 101 | */ |
| 102 | - const INDEX = 1000; //Default index type |
|
| 103 | - const UNIQUE = 2000; //Unique index definition |
|
| 102 | + const INDEX = 1000; //Default index type |
|
| 103 | + const UNIQUE = 2000; //Unique index definition |
|
| 104 | 104 | |
| 105 | 105 | /* |
| 106 | 106 | * ================================================ |
@@ -307,11 +307,11 @@ discard block |
||
| 307 | 307 | $this->dispatch('insert', new RecordEvent($this, $command)); |
| 308 | 308 | |
| 309 | 309 | //Executed when transaction successfully completed |
| 310 | - $command->onComplete(function (InsertCommand $command) { |
|
| 310 | + $command->onComplete(function(InsertCommand $command) { |
|
| 311 | 311 | $this->handleInsert($command); |
| 312 | 312 | }); |
| 313 | 313 | |
| 314 | - $command->onRollBack(function () { |
|
| 314 | + $command->onRollBack(function() { |
|
| 315 | 315 | //Flushing existed insert command to prevent collisions |
| 316 | 316 | $this->firstInsert = null; |
| 317 | 317 | }); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | ); |
| 333 | 333 | |
| 334 | 334 | if (!empty($this->firstInsert)) { |
| 335 | - $this->firstInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 335 | + $this->firstInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 336 | 336 | //Sync primary key values |
| 337 | 337 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); |
| 338 | 338 | }); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $this->dispatch('update', new RecordEvent($this)); |
| 344 | 344 | |
| 345 | 345 | //Executed when transaction successfully completed |
| 346 | - $command->onComplete(function (UpdateCommand $command) { |
|
| 346 | + $command->onComplete(function(UpdateCommand $command) { |
|
| 347 | 347 | $this->handleUpdate($command); |
| 348 | 348 | }); |
| 349 | 349 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | ); |
| 362 | 362 | |
| 363 | 363 | if (!empty($this->firstInsert)) { |
| 364 | - $this->firstInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
| 364 | + $this->firstInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
| 365 | 365 | //Sync primary key values |
| 366 | 366 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); |
| 367 | 367 | }); |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | $this->dispatch('delete', new RecordEvent($this)); |
| 373 | 373 | |
| 374 | 374 | //Executed when transaction successfully completed |
| 375 | - $command->onComplete(function (DeleteCommand $command) { |
|
| 375 | + $command->onComplete(function(DeleteCommand $command) { |
|
| 376 | 376 | $this->handleDelete($command); |
| 377 | 377 | }); |
| 378 | 378 | |