You need to implement the method getUploadDir. When using this class in an entity certain life cycle callbacks should be called prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() upload for @ORM\PostPersist() and @ORM\PostUpdate() remove for @ORM\PostRemove()
Пример #1
0
 /**
  * This function should be called for the life cycle event @ORM\PostRemove()
  */
 public function remove()
 {
     if (static::GENERATE_THUMBNAILS && is_dir($this->getUploadRootDir())) {
         Model::deleteThumbnails($this->getUploadRootDir(), $this->fileName);
         return;
     }
     parent::remove();
 }