Esempio n. 1
0
 /**
  * Delete image from file storage and database
  *
  * @param FileModelInterface $model File being deleted
  */
 public function deleteFile(FileModelInterface $model)
 {
     $url = $model->getUploadDir() . DS . $model->getFile();
     @unlink(str_replace('..', '', $url));
     $model->delete();
 }
Esempio n. 2
0
 protected function addFileToArray(FileModelInterface $model, array &$paths)
 {
     $path = $model->getUploadDir() . DS . $model->getFile();
     if (is_file($path) && is_readable($path)) {
         $parent = $model->getParentFileModel();
         $name = constant($parent::TABLE_MAP . "::TABLE_NAME");
         $paths[$name . DS . $model->getFile()] = $path;
     }
 }