@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $finder = Orm::finder($modelClass); |
| 41 | 41 | |
| 42 | 42 | return $finder->select() |
| 43 | - ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | - ->execute(); |
|
| 43 | + ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | + ->execute(); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $finder = Orm::finder($modelClass); |
| 41 | 41 | |
| 42 | 42 | return $finder->select() |
| 43 | - ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | - ->one(); |
|
| 43 | + ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | + ->one(); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $finder = Orm::finder($modelClass); |
| 41 | 41 | |
| 42 | 42 | return $finder->select() |
| 43 | - ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | - ->one(); |
|
| 43 | + ->where($foreignAttribute, $this->getAttribute($attribute)) |
|
| 44 | + ->one(); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | return false; |
| 313 | 313 | } |
| 314 | 314 | if (true === $this->isLoaded()) { |
| 315 | - if (false === $this->beforeUpdate()){ |
|
| 315 | + if (false === $this->beforeUpdate()) { |
|
| 316 | 316 | return false; |
| 317 | 317 | } |
| 318 | 318 | if ($this->useTimestamps()) { |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | */ |
| 458 | 458 | protected function getQueryBuilderInstance() |
| 459 | 459 | { |
| 460 | - $connection = Orm::getConnection(); |
|
| 460 | + $connection = Orm::getConnection(); |
|
| 461 | 461 | |
| 462 | 462 | return new QueryBuilder( |
| 463 | 463 | $connection, |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | static public function getEmitter() |
| 61 | 61 | { |
| 62 | - if (! static::$emitter instanceof EventEmitter) { |
|
| 62 | + if (!static::$emitter instanceof EventEmitter) { |
|
| 63 | 63 | static::$emitter = new EventEmitter(); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $result; |
| 89 | - } |
|
| 90 | - catch (Exception $ex) { |
|
| 89 | + } catch (Exception $ex) { |
|
| 91 | 90 | $connection->rollback(); |
| 92 | 91 | throw $ex; |
| 93 | 92 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | public function query($sql, $params = [], $page = null, $perPage = 20) |
| 131 | 131 | { |
| 132 | 132 | if (!is_null($page)) { |
| 133 | - $page = (int) $page; |
|
| 133 | + $page = (int) $page; |
|
| 134 | 134 | if ($page < 1) { |
| 135 | 135 | $page = 1; |
| 136 | 136 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | protected function generateCallback() |
| 220 | 220 | { |
| 221 | - return function ($query, $sql, $params) { |
|
| 221 | + return function($query, $sql, $params) { |
|
| 222 | 222 | $sql = trim($sql); |
| 223 | 223 | Orm::getEmitter()->emit('query.init', [ |
| 224 | 224 | $sql, |
@@ -167,7 +167,7 @@ |
||
| 167 | 167 | return false; |
| 168 | 168 | } |
| 169 | 169 | if (true === $this->isLoaded()) { |
| 170 | - if (false === $this->beforeUpdate()){ |
|
| 170 | + if (false === $this->beforeUpdate()) { |
|
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | 173 | if ($this->useTimestamps()) { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function hydrate(array $array, Model $model) |
| 31 | 31 | { |
| 32 | - $closure = function ($data) { |
|
| 32 | + $closure = function($data) { |
|
| 33 | 33 | $this->data = $data; |
| 34 | 34 | $this->afterLoad(); |
| 35 | 35 | }; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function dehydrate(Model $model) |
| 48 | 48 | { |
| 49 | - $closure = function () { |
|
| 49 | + $closure = function() { |
|
| 50 | 50 | return $this->data; |
| 51 | 51 | }; |
| 52 | 52 | $dehydrator = $closure->bindTo($model, $model); |