@@ -100,13 +100,13 @@ |
||
100 | 100 | ]; |
101 | 101 | } |
102 | 102 | |
103 | - if($this->hasAttribute('lft')&&$this->hasAttribute('rgt')&&$this->hasAttribute('depth')){ |
|
103 | + if ($this->hasAttribute('lft') && $this->hasAttribute('rgt') && $this->hasAttribute('depth')) { |
|
104 | 104 | $behaviors['tree'] = ArrayHelper::merge([ |
105 | 105 | 'class' => NestedSetsBehavior::className(), |
106 | 106 | 'leftAttribute' => 'lft', |
107 | 107 | 'rightAttribute' => 'rgt', |
108 | 108 | 'depthAttribute' => 'depth', |
109 | - ], ($this->hasAttribute('tree')?['treeAttribute' => 'tree']:[])); |
|
109 | + ], ($this->hasAttribute('tree') ? ['treeAttribute' => 'tree'] : [])); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $behaviors; |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by PhpStorm. |
|
4 | - * User: vadim |
|
5 | - * Date: 22.01.15 |
|
6 | - * Time: 13:47 |
|
7 | - */ |
|
3 | + * Created by PhpStorm. |
|
4 | + * User: vadim |
|
5 | + * Date: 22.01.15 |
|
6 | + * Time: 13:47 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace sibds\components; |
10 | 10 |
@@ -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 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $condition = array_merge($condition, $property->getValue($obj)); |
19 | 19 | } |
20 | 20 | } |
21 | - if($obj->hasAttribute($obj->removedAttribute)) |
|
21 | + if ($obj->hasAttribute($obj->removedAttribute)) |
|
22 | 22 | return (new \sibds\behaviors\TrashQuery($obj))->findRemoved()->andFilterWhere($condition); |
23 | 23 | else |
24 | 24 | return parent::find()->andFilterWhere($condition); |
@@ -18,9 +18,10 @@ |
||
18 | 18 | $condition = array_merge($condition, $property->getValue($obj)); |
19 | 19 | } |
20 | 20 | } |
21 | - if($obj->hasAttribute($obj->removedAttribute)) |
|
22 | - return (new \sibds\behaviors\TrashQuery($obj))->findRemoved()->andFilterWhere($condition); |
|
23 | - else |
|
24 | - return parent::find()->andFilterWhere($condition); |
|
21 | + if($obj->hasAttribute($obj->removedAttribute)) { |
|
22 | + return (new \sibds\behaviors\TrashQuery($obj))->findRemoved()->andFilterWhere($condition); |
|
23 | + } else { |
|
24 | + return parent::find()->andFilterWhere($condition); |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | } |