Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function createForm($options, $defaultData = null)
 {
     $form = $this->getFormService($options);
     $this->buildForm($form);
     $this->formHandler->initForm($form, $defaultData);
     $this->eventDispatcher->dispatchOnFormInitEvent($this, $form);
     return $form;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function removeResource($resource)
 {
     $this->eventDispatcher->dispatchOnPreRemoveResource($resource);
     $em = $this->getDoctrineHelper()->getEntityManager();
     $em->remove($resource);
     $em->flush();
     $this->eventDispatcher->dispatchOnPostRemoveResource($resource);
 }