Commit 402f07384ee4d43b996765acc4909c7e17cc1504
1 parent
ee550146
-
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
common/modules/product/models/Category.php
| @@ -202,4 +202,9 @@ class Category extends \yii\db\ActiveRecord | @@ -202,4 +202,9 @@ class Category extends \yii\db\ActiveRecord | ||
| 202 | } | 202 | } |
| 203 | return false; | 203 | return false; |
| 204 | } | 204 | } |
| 205 | + | ||
| 206 | + public function afterDelete() | ||
| 207 | + { | ||
| 208 | + ProductCategory::deleteAll(['category_id' => $this->category_id]); | ||
| 209 | + } | ||
| 205 | } | 210 | } |