public function preSetData(FormEvent $event)
    {  
        $entity = $event->getData();

        if ($entity instanceof ImageInterface && null !== $entity->getId()){
            try{
                $this->imageManager->copyImagesToTemporaryDirectory($entity);
            } catch(\Gaufrette\Exception\FileNotFound $e){ 
                $event->setData(null);
            }
        }
    }
public function preSetData(FormEvent $event)
    {  
        $entity = $event->getData();

        if ($entity instanceof ImageInterface && null !== $entity->getId()){
            try{
                $this->imageManager->copyImagesToTemporaryDirectory($entity);
            } catch(\Gaufrette\Exception\FileNotFound $e){ 
                $event->setData(null);
            }
        }
    }
public function preSetData ( FormEvent $ event ) { $ entity = $ event -> getData ( ) ; if ( $ entity instanceof ImageInterface && null !== $ entity -> getId ( ) ) { try { $ this -> imageManager -> copyImagesToTemporaryDirectory ( $ entity ) ; } catch ( \ Gaufrette \ Exception \ FileNotFound $ e ) { $ event -> setData ( null ) ; } } }
Copy image to temporary directory

@param FilterDataEvent $event
@return void
Copy image to temporary directory