@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $currentCondition = []; |
78 | 78 | /** @var ActiveRecord $owner */ |
79 | 79 | $owner = $this->owner; |
80 | - foreach ((array)$this->conditionAttributes as $attribute) { |
|
80 | + foreach ((array) $this->conditionAttributes as $attribute) { |
|
81 | 81 | if (!$owner->hasAttribute($attribute)) { |
82 | 82 | continue; |
83 | 83 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | $owner = $this->owner; |
147 | 147 | $condition = $this->getCondition(); |
148 | - $newSort = $owner->{$this->sortAttribute} + $value; |
|
148 | + $newSort = $owner->{$this->sortAttribute} +$value; |
|
149 | 149 | if ($value > 0) { |
150 | 150 | // move up |
151 | 151 | $max = $this->getMaxSort(); |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | [$this->sortAttribute => new Expression('(@sortingCount:=(@sortingCount+1))')], |
196 | 196 | $this->getCondition(), |
197 | 197 | $params |
198 | - ) . ' ' . $builder->buildOrderBy($orderFields); |
|
199 | - $db->createCommand('set @sortingCount=-1;' . $query, $params)->execute(); |
|
198 | + ).' '.$builder->buildOrderBy($orderFields); |
|
199 | + $db->createCommand('set @sortingCount=-1;'.$query, $params)->execute(); |
|
200 | 200 | // update in current record |
201 | 201 | if (!$owner->getIsNewRecord()) { |
202 | 202 | $owner->{$this->sortAttribute} = $owner->findOne($owner->getPrimaryKey())->{$this->sortAttribute}; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | protected function getCondition() |
222 | 222 | { |
223 | 223 | $condition = ['and']; |
224 | - foreach ((array)$this->conditionAttributes as $attribute) { |
|
224 | + foreach ((array) $this->conditionAttributes as $attribute) { |
|
225 | 225 | if ($this->owner->hasAttribute($attribute)) { |
226 | 226 | $condition[] = [$attribute => $this->owner->$attribute]; |
227 | 227 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function relativeMove($model, $position) |
238 | 238 | { |
239 | - $conditionAttributes = (array)$this->conditionAttributes; |
|
239 | + $conditionAttributes = (array) $this->conditionAttributes; |
|
240 | 240 | $owner = $this->owner; |
241 | 241 | |
242 | 242 | if (!empty($conditionAttributes)) { |