@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'language_id' |
97 | 97 | ], |
98 | 98 | 'unique', |
99 | - 'targetAttribute' => ['contacts_id', 'language_id'] |
|
99 | + 'targetAttribute' => [ 'contacts_id', 'language_id' ] |
|
100 | 100 | ], |
101 | 101 | [ |
102 | 102 | [ |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'exist', |
106 | 106 | 'skipOnError' => true, |
107 | 107 | 'targetClass' => Contact::class, |
108 | - 'targetAttribute' => ['contacts_id' => 'id'] |
|
108 | + 'targetAttribute' => [ 'contacts_id' => 'id' ] |
|
109 | 109 | ], |
110 | 110 | [ |
111 | 111 | [ |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'exist', |
115 | 115 | 'skipOnError' => true, |
116 | 116 | 'targetClass' => Language::class, |
117 | - 'targetAttribute' => ['language_id' => 'id'] |
|
117 | + 'targetAttribute' => [ 'language_id' => 'id' ] |
|
118 | 118 | ], |
119 | 119 | ]; |
120 | 120 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function search($params) |
58 | 58 | { |
59 | - $query = Product::find()->joinWith(['productsLanguages']); |
|
59 | + $query = Product::find()->joinWith([ 'productsLanguages' ]); |
|
60 | 60 | |
61 | 61 | // add conditions that should always apply here |
62 | 62 | |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | 'active' => $this->active, |
79 | 79 | ]); |
80 | 80 | |
81 | - $query->andFilterWhere(['like', 'products_language.title', $this->title]); |
|
81 | + $query->andFilterWhere([ 'like', 'products_language.title', $this->title ]); |
|
82 | 82 | |
83 | 83 | $pagination = new Pagination([ |
84 | - 'defaultPageSize' => Yii::$app->params['defaultPageSize'], |
|
84 | + 'defaultPageSize' => Yii::$app->params[ 'defaultPageSize' ], |
|
85 | 85 | 'totalCount' => $query->count(), |
86 | 86 | ]); |
87 | 87 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | if ($this->validate()) { |
70 | 70 | Yii::$app->mailer->compose() |
71 | 71 | ->setTo($email) |
72 | - ->setFrom([$this->email => $this->name]) |
|
72 | + ->setFrom([ $this->email => $this->name ]) |
|
73 | 73 | ->setSubject($this->subject) |
74 | 74 | ->setTextBody($this->body) |
75 | 75 | ->send(); |
@@ -76,18 +76,18 @@ |
||
76 | 76 | 'max' => 255, |
77 | 77 | ], |
78 | 78 | [ |
79 | - ['pages_id'], |
|
79 | + [ 'pages_id' ], |
|
80 | 80 | 'exist', |
81 | 81 | 'skipOnError' => true, |
82 | 82 | 'targetClass' => Page::class, |
83 | - 'targetAttribute' => ['pages_id' => 'id'], |
|
83 | + 'targetAttribute' => [ 'pages_id' => 'id' ], |
|
84 | 84 | ], |
85 | 85 | [ |
86 | - ['language_id'], |
|
86 | + [ 'language_id' ], |
|
87 | 87 | 'exist', |
88 | 88 | 'skipOnError' => true, |
89 | 89 | 'targetClass' => Language::class, |
90 | - 'targetAttribute' => ['language_id' => 'id'], |
|
90 | + 'targetAttribute' => [ 'language_id' => 'id' ], |
|
91 | 91 | ], |
92 | 92 | ]; |
93 | 93 | } |
@@ -174,8 +174,8 @@ |
||
174 | 174 | if ($this->save()) { |
175 | 175 | Yii::$app->mailer->compose() |
176 | 176 | ->setTo($email) |
177 | - ->setFrom([$this->email => $this->name]) |
|
178 | - ->setSubject('New message from bizness-develop feedback. ' . $this->subject) |
|
177 | + ->setFrom([ $this->email => $this->name ]) |
|
178 | + ->setSubject('New message from bizness-develop feedback. '.$this->subject) |
|
179 | 179 | ->setTextBody($this->message) |
180 | 180 | ->send(); |
181 | 181 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 'language_id' |
82 | 82 | ], |
83 | 83 | 'unique', |
84 | - 'targetAttribute' => ['about_id', 'language_id'] |
|
84 | + 'targetAttribute' => [ 'about_id', 'language_id' ] |
|
85 | 85 | ], |
86 | 86 | [ |
87 | 87 | [ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'exist', |
91 | 91 | 'skipOnError' => true, |
92 | 92 | 'targetClass' => About::class, |
93 | - 'targetAttribute' => ['about_id' => 'id'] |
|
93 | + 'targetAttribute' => [ 'about_id' => 'id' ] |
|
94 | 94 | ], |
95 | 95 | [ |
96 | 96 | [ |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'exist', |
100 | 100 | 'skipOnError' => true, |
101 | 101 | 'targetClass' => Language::class, |
102 | - 'targetAttribute' => ['language_id' => 'id'] |
|
102 | + 'targetAttribute' => [ 'language_id' => 'id' ] |
|
103 | 103 | ], |
104 | 104 | ]; |
105 | 105 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $dataProvider->setSort([ |
79 | 79 | 'attributes' => [ |
80 | 80 | 'order' => [ |
81 | - 'asc' => ['order' => SORT_ASC], |
|
82 | - 'desc' => ['order' => SORT_DESC], |
|
81 | + 'asc' => [ 'order' => SORT_ASC ], |
|
82 | + 'desc' => [ 'order' => SORT_DESC ], |
|
83 | 83 | 'label' => 'Order', |
84 | 84 | 'default' => SORT_ASC |
85 | 85 | ], |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | 'updated_at' => $this->updated_at, |
104 | 104 | ]); |
105 | 105 | |
106 | - $query->andFilterWhere(['like', 'first_name', $this->first_name]) |
|
107 | - ->andFilterWhere(['like', 'last_name', $this->last_name]) |
|
108 | - ->andFilterWhere(['like', 'patronymic', $this->patronymic]) |
|
109 | - ->andFilterWhere(['like', 'position', $this->position]) |
|
110 | - ->andFilterWhere(['like', 'login', $this->login]) |
|
111 | - ->andFilterWhere(['like', 'email', $this->email]) |
|
112 | - ->andFilterWhere(['like', 'phone', $this->phone]); |
|
106 | + $query->andFilterWhere([ 'like', 'first_name', $this->first_name ]) |
|
107 | + ->andFilterWhere([ 'like', 'last_name', $this->last_name ]) |
|
108 | + ->andFilterWhere([ 'like', 'patronymic', $this->patronymic ]) |
|
109 | + ->andFilterWhere([ 'like', 'position', $this->position ]) |
|
110 | + ->andFilterWhere([ 'like', 'login', $this->login ]) |
|
111 | + ->andFilterWhere([ 'like', 'email', $this->email ]) |
|
112 | + ->andFilterWhere([ 'like', 'phone', $this->phone ]); |
|
113 | 113 | |
114 | 114 | $query->orderBy('order ASC'); |
115 | 115 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | 'social_id' |
50 | 50 | ], |
51 | 51 | 'unique', |
52 | - 'targetAttribute' => ['contacts_id', 'social_id'] |
|
52 | + 'targetAttribute' => [ 'contacts_id', 'social_id' ] |
|
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | [ |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'exist', |
59 | 59 | 'skipOnError' => true, |
60 | 60 | 'targetClass' => Contact::class, |
61 | - 'targetAttribute' => ['contacts_id' => 'id'] |
|
61 | + 'targetAttribute' => [ 'contacts_id' => 'id' ] |
|
62 | 62 | ], |
63 | 63 | [ |
64 | 64 | [ |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'exist', |
68 | 68 | 'skipOnError' => true, |
69 | 69 | 'targetClass' => Social::class, |
70 | - 'targetAttribute' => ['social_id' => 'id'] |
|
70 | + 'targetAttribute' => [ 'social_id' => 'id' ] |
|
71 | 71 | ], |
72 | 72 | ]; |
73 | 73 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getSettings() |
111 | 111 | { |
112 | - $result = $this->db->createCommand('SELECT * FROM ' . $this->tableName) |
|
112 | + $result = $this->db->createCommand('SELECT * FROM '.$this->tableName) |
|
113 | 113 | ->queryOne(); |
114 | 114 | |
115 | 115 | $this->setAttributes($result, false); |
@@ -128,14 +128,14 @@ discard block |
||
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | |
131 | - $count = (int)$this->db->createCommand('SELECT COUNT(*) FROM ' . $this->tableName)->queryScalar(); |
|
131 | + $count = (int)$this->db->createCommand('SELECT COUNT(*) FROM '.$this->tableName)->queryScalar(); |
|
132 | 132 | |
133 | 133 | if ($count > 0) { |
134 | - $result = $this->db->createCommand('UPDATE ' . $this->tableName. ' SET ' . $this->queryUpdateAttributes()) |
|
134 | + $result = $this->db->createCommand('UPDATE '.$this->tableName.' SET '.$this->queryUpdateAttributes()) |
|
135 | 135 | ->bindValues($this->attributesToBind()) |
136 | 136 | ->execute(); |
137 | 137 | } else { |
138 | - $result = $this->db->createCommand('INSERT INTO ' . $this->tableName. ' ' . $this->queryInsertAttributes()) |
|
138 | + $result = $this->db->createCommand('INSERT INTO '.$this->tableName.' '.$this->queryInsertAttributes()) |
|
139 | 139 | ->bindValues($this->attributesToBind()) |
140 | 140 | ->execute(); |
141 | 141 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function attributesToBind(): array |
154 | 154 | { |
155 | - $attributesToBind = []; |
|
155 | + $attributesToBind = [ ]; |
|
156 | 156 | |
157 | 157 | foreach ($this->getAttributes() as $name => $value) { |
158 | - $attributesToBind[':' . $name] = $value; |
|
158 | + $attributesToBind[ ':'.$name ] = $value; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $attributesToBind; |
@@ -166,10 +166,10 @@ discard block |
||
166 | 166 | */ |
167 | 167 | private function queryUpdateAttributes(): string |
168 | 168 | { |
169 | - $toUpdateArray = []; |
|
169 | + $toUpdateArray = [ ]; |
|
170 | 170 | |
171 | 171 | foreach ($this->getAttributes() as $name => $value) { |
172 | - $toUpdateArray[] = $name . ' = :' . $name; |
|
172 | + $toUpdateArray[ ] = $name.' = :'.$name; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | return implode(', ', $toUpdateArray); |
@@ -180,16 +180,16 @@ discard block |
||
180 | 180 | */ |
181 | 181 | private function queryInsertAttributes(): string |
182 | 182 | { |
183 | - $toInsertArrayNames = []; |
|
184 | - $toInsertArrayValues = []; |
|
183 | + $toInsertArrayNames = [ ]; |
|
184 | + $toInsertArrayValues = [ ]; |
|
185 | 185 | |
186 | 186 | foreach ($this->getAttributes() as $name => $value) { |
187 | - $toInsertArrayNames[] = $name; |
|
188 | - $toInsertArrayValues[] = ':' . $name; |
|
187 | + $toInsertArrayNames[ ] = $name; |
|
188 | + $toInsertArrayValues[ ] = ':'.$name; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | return |
192 | - ' (' . implode(', ', $toInsertArrayNames) . ') VALUES ' . |
|
193 | - ' (' . implode(', ', $toInsertArrayValues) . ') '; |
|
192 | + ' ('.implode(', ', $toInsertArrayNames).') VALUES '. |
|
193 | + ' ('.implode(', ', $toInsertArrayValues).') '; |
|
194 | 194 | } |
195 | 195 | } |