Example #1
0
 /**
  * @param \StorageBundle\Entity\File $file
  */
 public function saveFile(\StorageBundle\Entity\File $file)
 {
     $fullPath = $this->getFilePath($file->getCategory());
     if ($this->oldFilePath && file_exists($this->oldFilePath)) {
         unlink($this->oldFilePath);
     }
     $file->upload($fullPath);
 }