/** * {@inheritDoc} */ public function removeImagesFromPermanentDirectory(ImageInterface $object) { try { $name = $object->getName(); if (empty($name)) { return; } $this->mediaFilesystem->delete($object->getImagePath()); $this->mediaFilesystem->delete($this->getPermanentOriginalImagePath($object)); } catch (FileNotFound $e) { } }
/** * Checks if images is modified by some other user * * @param ImageInterface $entity * @param string $hash * @throws FileHashChangedException */ protected function checksum(ImageInterface $entity) { $currentHash = $this->imageManager->checksumTemporaryFileByName($entity->getName()); if ($entity->getHash() !== $currentHash) { throw new FileHashChangedException($entity->getName()); } }