@@ -110,8 +110,9 @@ |
||
| 110 | 110 | public function duplicate() { |
| 111 | 111 | $this->isNewRecord = true; |
| 112 | 112 | |
| 113 | - foreach ($this->primaryKey() as $key) |
|
| 114 | - $this->$key = null; |
|
| 113 | + foreach ($this->primaryKey() as $key) { |
|
| 114 | + $this->$key = null; |
|
| 115 | + } |
|
| 115 | 116 | |
| 116 | 117 | if ($this->save()) { |
| 117 | 118 | return $this; |
@@ -29,8 +29,9 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $owner = $this->owner; |
| 31 | 31 | if ($owner->hasAttribute($this->lockedAttribute)) { |
| 32 | - if (empty($owner->{$this->lockedAttribute}) || is_null($owner->{$this->lockedAttribute})) |
|
| 33 | - $owner->{$this->lockedAttribute} = $this->valueUnlock; |
|
| 32 | + if (empty($owner->{$this->lockedAttribute}) || is_null($owner->{$this->lockedAttribute})) { |
|
| 33 | + $owner->{$this->lockedAttribute} = $this->valueUnlock; |
|
| 34 | + } |
|
| 34 | 35 | } |
| 35 | 36 | } |
| 36 | 37 | |
@@ -17,8 +17,9 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function init() |
| 19 | 19 | { |
| 20 | - if (is_null($this->userClass)) |
|
| 21 | - $this->userClass = \Yii::$app->user->className(); |
|
| 20 | + if (is_null($this->userClass)) { |
|
| 21 | + $this->userClass = \Yii::$app->user->className(); |
|
| 22 | + } |
|
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | /** |