| @@ 309-326 (lines=18) @@ | ||
| 306 | /** |
|
| 307 | * @inheritdoc |
|
| 308 | */ |
|
| 309 | public function beforeDelete() |
|
| 310 | { |
|
| 311 | if (!parent::beforeDelete()) { |
|
| 312 | return false; |
|
| 313 | } |
|
| 314 | ||
| 315 | $activeParts = ThemeWidgetApplying::find()->where(['part_id'=>$this->id])->all(); |
|
| 316 | foreach ($activeParts as $part) { |
|
| 317 | $part->delete(); |
|
| 318 | } |
|
| 319 | ||
| 320 | $activeWidgets = ThemeActiveWidgets::find()->where(['widget_id'=>$this->id])->all(); |
|
| 321 | foreach ($activeWidgets as $widget) { |
|
| 322 | $widget->delete(); |
|
| 323 | } |
|
| 324 | ||
| 325 | return true; |
|
| 326 | } |
|
| 327 | } |
|
| 328 | ||
| @@ 153-170 (lines=18) @@ | ||
| 150 | /** |
|
| 151 | * @inheritdoc |
|
| 152 | */ |
|
| 153 | public function beforeDelete() |
|
| 154 | { |
|
| 155 | if (!parent::beforeDelete()) { |
|
| 156 | return false; |
|
| 157 | } |
|
| 158 | ||
| 159 | $parts = ThemeWidgetApplying::find()->where(['widget_id'=>$this->id])->all(); |
|
| 160 | foreach ($parts as $part) { |
|
| 161 | $part->delete(); |
|
| 162 | } |
|
| 163 | ||
| 164 | $activeWidgets = ThemeActiveWidgets::find()->where(['widget_id'=>$this->id])->all(); |
|
| 165 | foreach ($activeWidgets as $widget) { |
|
| 166 | $widget->delete(); |
|
| 167 | } |
|
| 168 | ||
| 169 | return true; |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||