Common\Doctrine\ValueObject\AbstractFile::remove PHP Метод

remove() публичный Метод

This function should be called for the life cycle event @ORM\PostRemove()
public remove ( )
    public function remove()
    {
        $file = $this->getAbsolutePath();
        if (!is_file($file) || !file_exists($file)) {
            return;
        }
        unlink($file);
    }

Usage Example

Пример #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();
 }