예제 #1
0
 /**
  * {@inheritdoc}
  */
 protected function onSuccess($entity)
 {
     if (null === $entity->getOrganization()) {
         $entity->setOrganization($this->organization);
     }
     parent::onSuccess($entity);
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 /**
  * {@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);
 }
예제 #6
0
 /**
  * @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;
 }
예제 #7
0
 /**
  * @param Email $entity
  *
  * @return EmailModel
  */
 protected function prepareFormData($entity)
 {
     return parent::prepareFormData(new EmailModel($entity));
 }
예제 #8
0
 /**
  * @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;
 }