Beispiel #1
0
 public function afterDelete()
 {
     parent::afterDelete();
     Yii::$app->getModule('image')->fsComponent->delete($this->watermark_path);
     $thumbnailWatermarks = ThumbnailWatermark::findAll(['water_id' => $this->id]);
     foreach ($thumbnailWatermarks as $thumbnailWatermark) {
         $thumbnailWatermark->delete();
     }
 }
Beispiel #2
0
 /**
  * @inheritdoc
  * @throws \Exception
  */
 public function afterDelete()
 {
     parent::afterDelete();
     $sameImages = static::findAll(['thumb_path' => $this->thumb_path]);
     if (empty($sameImages) === true) {
         if (Yii::$app->getModule('image')->fsComponent->has($this->thumb_path)) {
             Yii::$app->getModule('image')->fsComponent->delete($this->thumb_path);
         }
         $thumbnailWatermarks = ThumbnailWatermark::findAll(['thumb_id' => $this->id]);
         foreach ($thumbnailWatermarks as $thumbnailWatermark) {
             $thumbnailWatermark->delete();
         }
     }
 }