/** * {@inheritdoc} */ protected function onSuccess($entity) { if (null === $entity->getOrganization()) { $entity->setOrganization($this->organization); } parent::onSuccess($entity); }
/** * Process form * * @param mixed $entity * * @return mixed|null The instance of saved entity on successful processing; otherwise, null */ public function process($entity) { if ($this->securityFacade->isGranted('EDIT', $entity)) { return parent::process($entity); } return null; }
/** * {@inheritdoc} */ public function process($entity) { if (!$this->taggableHelper->isTaggable($entity)) { throw new \LogicException('Target entity should be taggable.'); } return parent::process($entity); }
/** * {@inheritdoc} */ protected function onSuccess($entity) { $action = $this->entityRoutingHelper->getAction($this->request); if ($action === 'activity') { $this->activityManager->addActivityTarget($entity, $this->getTargetEntity()); } parent::onSuccess($entity); }
/** * Process form * * @param mixed $entity * * @return mixed|null The instance of saved entity on successful processing; otherwise, null */ public function process($entity) { $this->checkPermissions($entity); return parent::process($entity); }
/** * @param FormInterface $form * @param Request $request * @param ObjectManager $manager * @param EventDispatcherInterface $dispatcher */ public function __construct(FormInterface $form, Request $request, ObjectManager $manager, EventDispatcherInterface $dispatcher) { parent::__construct($form, $request, $manager); $this->dispatcher = $dispatcher; }
/** * @param Email $entity * * @return EmailModel */ protected function prepareFormData($entity) { return parent::prepareFormData(new EmailModel($entity)); }
/** * @param FormInterface $form * @param Request $request * @param ObjectManager $entityManager * @param ActivityManager $activityManager */ public function __construct(FormInterface $form, Request $request, ObjectManager $entityManager, ActivityManager $activityManager) { parent::__construct($form, $request, $entityManager); $this->activityManager = $activityManager; }