@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: vadim |
|
| 5 | - * Date: 05.02.16 |
|
| 6 | - * Time: 12:57 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: vadim |
|
| 5 | + * Date: 05.02.16 |
|
| 6 | + * Time: 12:57 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace sibds\components; |
| 10 | 10 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $owner = $this->owner; |
| 43 | 43 | |
| 44 | 44 | $owner->{$this->lockedAttribute} = $this->valueLock; |
| 45 | - if(!$owner->validate()) |
|
| 45 | + if (!$owner->validate()) |
|
| 46 | 46 | throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
| 47 | 47 | $owner->save(); |
| 48 | 48 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $owner = $this->owner; |
| 54 | 54 | |
| 55 | 55 | $owner->{$this->lockedAttribute} = $this->valueUnlock; |
| 56 | - if(!$owner->validate()) |
|
| 56 | + if (!$owner->validate()) |
|
| 57 | 57 | throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
| 58 | 58 | |
| 59 | 59 | $owner->save(); |
@@ -42,8 +42,9 @@ discard block |
||
| 42 | 42 | $owner = $this->owner; |
| 43 | 43 | |
| 44 | 44 | $owner->{$this->lockedAttribute} = $this->valueLock; |
| 45 | - if(!$owner->validate()) |
|
| 46 | - throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
|
| 45 | + if(!$owner->validate()) { |
|
| 46 | + throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
|
| 47 | + } |
|
| 47 | 48 | $owner->save(); |
| 48 | 49 | } |
| 49 | 50 | |
@@ -53,8 +54,9 @@ discard block |
||
| 53 | 54 | $owner = $this->owner; |
| 54 | 55 | |
| 55 | 56 | $owner->{$this->lockedAttribute} = $this->valueUnlock; |
| 56 | - if(!$owner->validate()) |
|
| 57 | - throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
|
| 57 | + if(!$owner->validate()) { |
|
| 58 | + throw new \yii\db\Exception('Error saving model! Validating not comlete: ' . implode('; ', $owner->firstErrors)); |
|
| 59 | + } |
|
| 58 | 60 | |
| 59 | 61 | $owner->save(); |
| 60 | 62 | } |