Esempio n. 1
0
 public function remove($obj, $mapping)
 {
     $mapping = $this->factory->fromName($obj, $mapping);
     $this->dispatch(Events::PRE_REMOVE, new Event($obj, $mapping));
     $this->storage->remove($obj, $mapping);
     $mapping->setFileName($obj, null);
     $this->dispatch(Events::POST_REMOVE, new Event($obj, $mapping));
 }
 /**
  * Removes the file if necessary.
  *
  * @param EventArgs $args The event arguments.
  */
 public function postRemove(EventArgs $args)
 {
     $obj = $this->adapter->getObjectFromArgs($args);
     if ($this->isUploadable($obj)) {
         $this->storage->remove($obj);
     }
 }
Esempio n. 3
0
 public function remove($obj, $fieldName)
 {
     $mapping = $this->getMapping($obj, $fieldName);
     $this->dispatch(Events::PRE_REMOVE, new Event($obj, $mapping));
     $this->storage->remove($obj, $mapping);
     $mapping->setFileName($obj, null);
     $this->dispatch(Events::POST_REMOVE, new Event($obj, $mapping));
 }