/** * Remove file * * @param string $path Path OPTIONAL * * @return void */ public function removeFile($path = null) { if (self::STORAGE_S3 == $this->getStorageType()) { $this->getS3()->delete($this->getStoragePath($path)); if ($this->getId()) { $dir = $this->getStoragePath('icon/' . $this->getId()); if ($this->getS3()->isDir($dir)) { $this->getS3()->deleteDirectory($dir); } } } else { parent::removeFile($path); } }