@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | $insertSql = new \Sirius\Sql\Insert($connection); |
30 | 30 | $insertSql->into($this->mapper->getTable()) |
31 | - ->columns($columns); |
|
31 | + ->columns($columns); |
|
32 | 32 | $insertSql->perform(); |
33 | 33 | $this->mapper->setEntityPk($this->entity, $connection->lastInsertId()); |
34 | 34 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | public function revert() |
37 | 37 | { |
38 | - if (! $this->hasRun) { |
|
38 | + if (!$this->hasRun) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | $this->mapper->setEntityPk($this->entity, $this->entityId); |
@@ -81,10 +81,10 @@ |
||
81 | 81 | $conn = $this->relation->getNativeMapper()->getWriteConnection(); |
82 | 82 | $throughTable = (string)$this->relation->getOption(RelationConfig::THROUGH_TABLE); |
83 | 83 | |
84 | - $throughNativeColumns = (array) $this->relation->getOption(RelationConfig::THROUGH_NATIVE_COLUMN); |
|
85 | - $throughForeignColumns = (array) $this->relation->getOption(RelationConfig::THROUGH_FOREIGN_COLUMN); |
|
86 | - $nativeKey = (array) $this->nativeMapper->getEntityPk($this->nativeEntity); |
|
87 | - $foreignKey = (array) $this->foreignMapper->getEntityPk($this->foreignEntity); |
|
84 | + $throughNativeColumns = (array)$this->relation->getOption(RelationConfig::THROUGH_NATIVE_COLUMN); |
|
85 | + $throughForeignColumns = (array)$this->relation->getOption(RelationConfig::THROUGH_FOREIGN_COLUMN); |
|
86 | + $nativeKey = (array)$this->nativeMapper->getEntityPk($this->nativeEntity); |
|
87 | + $foreignKey = (array)$this->foreignMapper->getEntityPk($this->foreignEntity); |
|
88 | 88 | |
89 | 89 | $delete = new \Sirius\Sql\Delete($conn); |
90 | 90 | $delete->from($throughTable); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | protected function execute() |
16 | 16 | { |
17 | 17 | $entityId = $this->mapper->getEntityPk($this->entity); |
18 | - if (! $entityId) { |
|
18 | + if (!$entityId) { |
|
19 | 19 | return; |
20 | 20 | } |
21 | 21 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function joinWith($name): Query |
81 | 81 | { |
82 | - if (! $this->mapper->hasRelation($name)) { |
|
82 | + if (!$this->mapper->hasRelation($name)) { |
|
83 | 83 | throw new \InvalidArgumentException( |
84 | 84 | sprintf("Relation %s, not defined for %s", $name, $this->mapper->getTable()) |
85 | 85 | ); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function chunk(int $size, callable $callback, int $limit = 100000) |
142 | 142 | { |
143 | 143 | if (!$this->orderBy->build()) { |
144 | - $this->orderBy(...(array) $this->mapper->getPrimaryKey()); |
|
144 | + $this->orderBy(...(array)$this->mapper->getPrimaryKey()); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | $run = 0; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $value = $this->castAttribute($attribute, $value); |
85 | - if (! isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) { |
|
85 | + if (!isset($this->attributes[$attribute]) || $value != $this->attributes[$attribute]) { |
|
86 | 86 | $this->changed[$attribute] = true; |
87 | 87 | $this->state = StateEnum::CHANGED; |
88 | 88 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | protected function get($attribute) |
95 | 95 | { |
96 | - if (! $attribute) { |
|
96 | + if (!$attribute) { |
|
97 | 97 | return null; |
98 | 98 | } |
99 | 99 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | public function getPersistenceState() |
106 | 106 | { |
107 | - if (! empty($this->changed)) { |
|
107 | + if (!empty($this->changed)) { |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | return $this->state; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $changes = $this->changed; |
135 | 135 | foreach ($this->attributes as $name => $value) { |
136 | 136 | if (is_object($value) && method_exists($value, 'getChanges')) { |
137 | - if (! empty($value->getChanges())) { |
|
137 | + if (!empty($value->getChanges())) { |
|
138 | 138 | $changes[$name] = true; |
139 | 139 | } |
140 | 140 | } |