From 0f985f01fbee392d93537fea7e579576dc1450df Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 1 Aug 2016 16:27:49 +0300 Subject: [PATCH] 20.07.16 --- common/modules/product/models/Category.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index aca9707..6bf3ac4 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -215,7 +215,12 @@ class Category extends \yii\db\ActiveRecord public function beforeDelete() { - print_r($this->products->deleteAll()); + + if(!empty($this->products)){ + foreach($this->products as $product){ + $product->delete(); + } + } die(); } -- libgit2 0.21.4