public function beforeDelete()
 {
     if (isset($this->path) && file_exists(\Yii::getAlias('@app') . '/../uploads/' . $this->path)) {
         unlink(\Yii::getAlias('@app') . '/../uploads/' . $this->path);
     }
     return parent::beforeDelete();
 }
Ejemplo n.º 2
0
 public function beforeDelete()
 {
     if (!empty($this->images)) {
         foreach ($this->images as $image) {
             $image->delete();
         }
     }
     return parent::beforeDelete();
 }