/** * {@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; }
/** * {@inheritdoc} */ public function removeResource($resource) { $this->eventDispatcher->dispatchOnPreRemoveResource($resource); $em = $this->getDoctrineHelper()->getEntityManager(); $em->remove($resource); $em->flush(); $this->eventDispatcher->dispatchOnPostRemoveResource($resource); }