Beispiel #1
0
 /**
  * Remove file from database and file system
  * @param File $file
  */
 private function removeFile(File $file)
 {
     $this->removeFileInFileSystem($file);
     if ($file instanceof Image) {
         $em = $this->getDoctrineEntityManager();
         $imageSizeCn = ImageSize::CN();
         $em->createQuery("DELETE FROM {$imageSizeCn} s WHERE s.master = :master")->setParameter('master', $file->getId())->execute();
     }
     $entityManager = $this->getDoctrineEntityManager();
     $entityManager->remove($file);
     $entityManager->flush();
 }
 /**
  * @param ImageSize $imageSize
  * @param string $baseDirectory
  * @return string
  */
 protected function getImageSizeTemporaryName(ImageSize $imageSize, $baseDirectory)
 {
     return $baseDirectory . DIRECTORY_SEPARATOR . $imageSize->getId() . '.size';
 }