Exemple #1
0
 public function afterDelete()
 {
     parent::afterDelete();
     foreach ($this->getPhotos()->all() as $photo) {
         $photo->delete();
     }
     if ($this->image) {
         @unlink(Yii::getAlias('@webroot') . $this->image);
     }
     ItemData::deleteAll(['item_id' => $this->primaryKey]);
 }