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();
	}
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();
	}
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 ( ) ; }
Remove file from database and file system
@param File $file
Remove file from database and file system