Beispiel #1
0
 /**
  * After model is deleted
  * - clean up it's thumbnails
  */
 public function afterDelete()
 {
     $this->deleteFile($this->disk_name);
     /*
      * Delete thumbs
      */
     $pattern = $this->getStorageDirectory() . $this->getPartitionDirectory() . 'thumb_' . $this->id . '_*';
     $thumbs = FileHelper::glob($pattern);
     if (is_array($thumbs)) {
         foreach ($thumbs as $thumb) {
             $this->deleteFile(basename($thumb));
         }
     }
 }