Exemplo n.º 1
0
 public function afterDelete()
 {
     parent::afterDelete();
     if ($this->image) {
         @unlink(Yii::getAlias('@webroot') . $this->image);
     }
 }
Exemplo n.º 2
0
 public function afterDelete()
 {
     parent::afterDelete();
     if ($this->image) {
         @unlink(Yii::getAlias('@webroot') . $this->image);
     }
     foreach ($this->getPhotos()->all() as $photo) {
         $photo->delete();
     }
 }