public function removeUpload(MediaInterface $media) { if ($media->getPath() === null) { return; } if ($this->filesystem->has($media->getPath())) { $this->filesystem->delete($media->getPath()); } }
protected function applyNamer(MediaInterface $media) { if ($media->getName() !== null) { return false; } $name = $this->namer->getName($media->getFile()); $media->setName($name); return true; }
public function removeUpload(MediaInterface $media) { // Image is new if ($media->getPath() === null) { return; } parent::removeUpload($media); // Remove from Imagine cache $this->cache->remove($media->getPath()); }
protected function getQuickUploadResponse(MediaInterface $media) { return new JsonResponse(['id' => $media->getId(), 'filename' => $media->getName(), 'filelink' => $this->getMediaLink($media)]); }
protected function getQuickUploadResponse(MediaInterface $media) { return new JsonResponse(['id' => $media->getId(), 'filelink' => $media->getWebPath()]); }