示例#1
0
 protected function denyLazaretFile(Application $app, LazaretFile $lazaretFile)
 {
     $lazaretFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getFilename();
     $lazaretThumbFileName = $app['root.path'] . '/tmp/lazaret/' . $lazaretFile->getThumbFilename();
     $app['EM']->remove($lazaretFile);
     $app['EM']->flush();
     try {
         $app['filesystem']->remove([$lazaretFileName, $lazaretThumbFileName]);
     } catch (IOException $e) {
     }
     return $this;
 }
 /**
  * {@inheritDoc}
  */
 public function getFilename()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getFilename', array());
     return parent::getFilename();
 }
 protected function denyLazaretFile(LazaretFile $lazaretFile)
 {
     $path = $this->app['tmp.lazaret.path'];
     $lazaretFileName = $path . '/' . $lazaretFile->getFilename();
     $lazaretThumbFileName = $path . '/' . $lazaretFile->getThumbFilename();
     $manager = $this->getEntityManager();
     $manager->remove($lazaretFile);
     $manager->flush();
     try {
         $this->getFilesystem()->remove([$lazaretFileName, $lazaretThumbFileName]);
     } catch (IOException $e) {
     }
     return $this;
 }