Put in this method post object creation processing if required.

@param  TaxRuleEvent $createEvent the create event
@return Response     a response, or null to continue normal processing
503898
protected function performAdditionalCreateAction($createEvent)
    {
        return $this->generateRedirectFromRoute(
            "admin.configuration.taxes-rules.update",
            $this->getViewArguments(),
            $this->getRouteArguments($createEvent->getTaxRule()->getId())
        );
    }
13020
def on_created(self, event):
        ''''''
        if self.trigger != "create":
            return
        action_input = ActionInput(event, "", self.name)
        flows.Global.MESSAGE_DISPATCHER.send_message(action_input)
467590
public function onRequest(RequestEvent $event)
    {
        if (!$this->wsaEnabled) {
            return;
        }

        $request = $event->getRequest();
        $envelope = $request->documentElement;
        $soapNS = $envelope->namespaceURI;

        $xpath = new \DOMXPath($event->getRequest());
        $xpath->registerNamespace('soap', $soapNS);
        $xpath->registerNamespace('wsa', self::NS_WSA);

        // Add WSA namespace to envelope
        $envelope->setAttributeNS(self::NS_XMLNS, 'xmlns:wsa', self::NS_WSA);

        // Find or create header
        $headers = $xpath->query('//soap:Envelope/soap:Header');
        $header = $headers->item(0);

        if (!$header) {
            $header = $request->createElementNS($soapNS, $envelope->prefix . ':Header');
            $envelope->insertBefore($header, $envelope->firstChild);
        }

        // Add MessageID
        $header->appendChild($request->createElementNS(self::NS_WSA, 'wsa:MessageID', 'uuid:' . Uuid::uuid4()));

        // Add Action
        $header->appendChild($request->createElementNS(self::NS_WSA, 'wsa:Action', $event->getAction()));

        // Add To
        $header->appendChild($request->createElementNS(self::NS_WSA, 'wsa:To', $event->getLocation()));

        // Add From
        if (false !== $this->getFrom()) {
            // use anonymous when set to true, given address otherwise
            $fromAddress = $this->getFrom() === true ? self::ANONYMOUS : $this->getFrom();
            $from = $request->createElementNS(self::NS_WSA, 'wsa:From');
            $from->appendChild($request->createElementNS(self::NS_WSA, 'wsa:Address', $fromAddress));
            $header->appendChild($from);
        }

        // Add ReplyTo
        if (!$event->isOneWay()) {
            $address = $this->address ?: self::ANONYMOUS;

            $replyTo = $request->createElementNS(self::NS_WSA, 'wsa:ReplyTo');
            $replyTo->appendChild($request->createElementNS(self::NS_WSA, 'wsa:Address', $address));

            $header->appendChild($replyTo);
        }
    }
480591
protected function getCreationEvent($formData)
    {
        $brandCreateEvent = new BrandCreateEvent();

        $brandCreateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setVisible($formData['visible'])
        ;

        return $brandCreateEvent;
    }
850370
public function onClientRequest(RequestEvent $event)
    {
        $errors = $this->validator->validate($event->getRequest());

        if (count($errors)) {
            throw new RequestException((string) $errors);
        }
    }
395807
@Override
    public T create(CreationalContext<T> creationalContext) {
        T instance = getProducer().produce(creationalContext);
        getProducer().inject(instance, creationalContext);

        if (!hasPostConstructCallback || beanManager.isContextActive(RequestScoped.class)) {
            getProducer().postConstruct(instance);
        } else {
            /*
             * CDI-219
             * The request scope is active during @PostConstruct callback of any bean.
             */
            RequestContext context = getUnboundRequestContext();
            try {
                context.activate();
                beanManager.fireRequestContextInitialized(getId());
                getProducer().postConstruct(instance);
            } finally {
                beanManager.fireRequestContextBeforeDestroyed(getId());
                context.invalidate();
                context.deactivate();
                beanManager.fireRequestContextDestroyed(getId());
            }
        }
        return instance;
    }
921822
function onQuickFormEvent($event, $arg, &$caller)
    {
        switch ($event) {
            case 'createElement':
                $this->_formid = $caller->getAttribute('id');
                break;
        }
        return parent::onQuickFormEvent($event, $arg, $caller);
    }
509461
public function postSubmit(FormEvent $event)
    {
        $form = $event->getForm();
        if (!$form->isValid()) {
            return;
        }

        $entity = $event->getData();
        $formHash = $this->getFormHash($form);
        $entityConfiguration = $this->getTranslatableEntityConfiguration($entity);

        if (is_null($entityConfiguration)) {
            return null;
        }

        $this->translationsBackup[$formHash] = [];

        $entityData = [
            'object' => $entity,
            'idGetter' => $entityConfiguration['idGetter'],
            'alias' => $entityConfiguration['alias'],
            'fields' => [],
        ];

        $entityFields = $entityConfiguration['fields'];

        foreach ($entityFields as $fieldName => $fieldConfiguration) {
            if (!isset($this->submittedDataPlain[$formHash][$fieldName])) {
                continue;
            }

            $field = $this->submittedDataPlain[$formHash][$fieldName];

            foreach ($this->locales as $locale) {
                $entityData['fields'][$fieldName][$locale] = $field[$locale . '_' . $fieldName];
            }

            if ($this->masterLocale && isset($field[$this->masterLocale . '_' . $fieldName])) {
                $masterLocaleData = $field[$this->masterLocale . '_' . $fieldName];
                $setter = $fieldConfiguration['setter'];
                $entity->$setter($masterLocaleData);
            }
        }

        $this->translationsBackup[$formHash][] = $entityData;
    }
241273
public function onPostSerialize(ObjectEvent $event)
    {
        $document = $event->getObject();

        if (!($document instanceof SecurityBehavior
            && $document instanceof LocaleBehavior
            && $document instanceof WebspaceBehavior
            && null !== $this->tokenStorage
            && null !== $this->tokenStorage->getToken()
            && $this->tokenStorage->getToken()->getUser() instanceof UserInterface)
        ) {
            return;
        }

        /** @var JsonSerializationVisitor $visitor */
        $visitor = $event->getVisitor();

        $visitor->addData(
            '_permissions',
            $this->accessControlManager->getUserPermissionByArray(
                $document->getLocale(),
                PageAdmin::SECURITY_CONTEXT_PREFIX . $document->getWebspaceName(),
                $document->getPermissions(),
                $this->tokenStorage->getToken()->getUser()
            )
        );
    }
1367213
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }
178508
public function afterCreate(PersistenceEvent $event) {
    if ($event->getAction() == PersistenceAction::CREATE) {
      $oldOid = $event->getOldOid();
      $oldOidStr = $oldOid != null ? $oldOid->__toString() : null;
      if ($oldOidStr != null && isset($this->createdTranslations[$oldOidStr])) {
        foreach ($this->createdTranslations[$oldOidStr] as $translation) {
          $translation->setValue('objectid', $event->getObject()->getOID()->__toString());
        }
      }
    }
  }
1168647
public function createAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth(self::CONTROLLER_CHECK_RESOURCE, Dealer::getModuleCode(),
                AccessManager::CREATE)
        ) {
            return $response;
        }

        // Create the Creation Form
        $creationForm = $this->getCreationForm($this->getRequest());

        $con = Propel::getConnection();
        $con->beginTransaction();

        try {
            // Check the form against constraints violations
            $form = $this->validateForm($creationForm, "POST");
            // Get the form field values
            $data = $form->getData();

            if (empty($data["day"])) {
                $dataAM = $this->formatData($data);
                $dataPM = $this->formatData($data, 'PM');

                if ($this->hasNullDate($dataAM) && $this->hasNullDate($dataPM)) {
                    $this->getService()->createFromArray($dataAM, $this->getCurrentEditionLocale());
                } else {
                    if (!$this->hasNullDate($dataAM)) {
                        $this->getService()->createFromArray($dataAM, $this->getCurrentEditionLocale());
                    }
                    if (!$this->hasNullDate($dataPM)) {
                        $this->getService()->createFromArray($dataPM, $this->getCurrentEditionLocale());
                    }
                }
            } else {
                foreach ($data["day"] as $day) {
                    $currentData = $data;
                    $currentData["day"] = $day;
                    $dataAM = $this->formatData($currentData);
                    $dataPM = $this->formatData($currentData, 'PM');

                    if ($this->hasNullDate($dataAM) && $this->hasNullDate($dataPM)) {
                        $this->getService()->createFromArray($dataAM, $this->getCurrentEditionLocale());
                    } else {
                        if (!$this->hasNullDate($dataAM)) {
                            $this->getService()->createFromArray($dataAM, $this->getCurrentEditionLocale());
                        }
                        if (!$this->hasNullDate($dataPM)) {
                            $this->getService()->createFromArray($dataPM, $this->getCurrentEditionLocale());
                        }
                    }
                }
            }


            // Substitute _ID_ in the URL with the ID of the created object
            $successUrl = $creationForm->getSuccessUrl();

            $con->commit();

            // Redirect to the success URL
            return $this->generateRedirect($successUrl);
        } catch (FormValidationException $ex) {
            $con->rollBack();
            // Form cannot be validated
            $error_msg = $this->createStandardFormValidationErrorMessage($ex);
        } catch (\Exception $ex) {
            $con->rollBack();
            // Any other error
            $error_msg = $ex->getMessage();
        }
        if (false !== $error_msg) {
            $this->setupFormErrorContext(
                $this->getTranslator()->trans("%obj creation", ['%obj' => static::CONTROLLER_ENTITY_NAME]),
                $error_msg,
                $creationForm,
                $ex
            );

            // At this point, the form has error, and should be redisplayed.
            return $this->generateErrorRedirect($creationForm);
        }
    }
1367638
public function onApiCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $form = new FileType(true);
        $form->enableApi();
        $form = $this->container->get('form.factory')->create($form, new File());
        $form->submit($this->container->get('request'));


        if ($form->isValid()) {
            $this->handleFileCreation($form, $event);
        }

        $event->setErrorFormContent($form);
        $event->stopPropagation();
    }
447678
public function onPostSerialize(ObjectEvent $event)
    {
        $document = $event->getObject();

        if (!$document instanceof LocaleBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor = $event->getVisitor();

        $visitor->addData('availableLocales', $this->documentInspector->getLocales($document));
        $visitor->addData('contentLocales', $this->documentInspector->getConcreteLocales($document));

        $localizationState = $this->documentInspector->getLocalizationState($document);

        if (LocalizationState::GHOST === $localizationState) {
            $visitor->addData('type', ['name' => 'ghost', 'value' => $document->getLocale()]);
        }

        if (LocalizationState::SHADOW === $localizationState) {
            $visitor->addData('type', ['name' => 'shadow', 'value' => $document->getLocale()]);
        }
    }
868824
public function onCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $em = $this->container->get('doctrine.orm.entity_manager');
        $user = $this->container->get('security.token_storage')->getToken()->getUser();
        $keys = array_keys($request->request->all());
        $id = array_pop($keys);
        $form = $this->container->get('claroline.form.factory')->create(FormFactory::TYPE_RESOURCE_TEXT, array($id));
        $form->handleRequest($request);

        if ($form->isValid()) {
            $published = $form->get('published')->getData();
            $event->setPublished($published);
            $revision = new Revision();
            $revision->setContent($form->getData()->getText());
            $revision->setUser($user);
            $text = new Text();
            $text->setName($form->getData()->getName());
            $revision->setText($text);
            $em->persist($text);
            $em->persist($revision);
            $event->setResources(array($text));
            $event->stopPropagation();

            return;
        }

        $errorForm = $this->container->get('claroline.form.factory')
            ->create(FormFactory::TYPE_RESOURCE_TEXT, array('text_'.rand(0, 1000000000)));
        $errorForm->setData($form->getData());
        $children = $form->getIterator();
        $errorChildren = $errorForm->getIterator();

        foreach ($children as $key => $child) {
            $errors = $child->getErrors();
            foreach ($errors as $error) {
                $errorChildren[$key]->addError($error);
            }
        }

        $content = $this->container->get('templating')->render(
            'ClarolineCoreBundle:Text:createForm.html.twig',
            array(
                'form' => $errorForm->createView(),
                'resourceType' => 'text'
            )
        );
        $event->setErrorFormContent($content);
        $event->stopPropagation();
    }
976070
public function postCreate(CreateEvent $event)
    {
        /** @var Role $role */
        $role = $event->getObject();

        if ($role->getWorkspace()) {
            $sql = "
              INSERT INTO claro_resource_rights (role_id, mask, resourceNode_id)
              SELECT {$role->getId()}, 1, resource.id FROM claro_resource_node resource
              WHERE resource.workspace_id = {$role->getWorkspace()->getId()}
            ";

            $stmt = $this->conn->prepare($sql);
            $stmt->execute();
        }
    }
655913
public function onCreate(CreateResourceEvent $event)
    {
        $request = $this->container->get('request');
        $form = $this->formFactory->create(new DirectoryType(), new Directory());
        $form->handleRequest($request);

        if ($form->isValid()) {
            $published = $form->get('published')->getData();
            $event->setPublished($published);
            $event->setResources(array($form->getData()));
            $event->stopPropagation();

            return;
        }

        $content = $this->templating->render(
            'ClarolineCoreBundle:Resource:createForm.html.twig',
            array(
                'form' => $form->createView(),
                'resourceType' => 'directory'
            )
        );
        $event->setErrorFormContent($content);
        $event->stopPropagation();
    }