Creates the update event with the provided form data

@param  array            $formData
@return BrandUpdateEvent
6173
protected function getUpdateEvent($formData)
    {
        $brandUpdateEvent = new BrandUpdateEvent($formData['id']);

        $brandUpdateEvent
            ->setLogoImageId($formData['logo_image_id'])
            ->setVisible($formData['visible'])
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setChapo($formData['chapo'])
            ->setDescription($formData['description'])
            ->setPostscriptum($formData['postscriptum'])
         ;

        return $brandUpdateEvent;
    }
831115
protected function getUpdateEvent($formData)
    {
        $event = new IndexEngineIndexEvent();

        $event->setId($formData["id"]);
        $event->setVisible($formData["visible"]);
        $event->setCode($formData["code"]);
        $event->setTitle($formData["title"]);
        $event->setType($formData["type"]);
        $event->setEntity($formData["entity"]);
        $event->setSerializedColumns($formData["serialized_columns"]);
        $event->setSerializedCondition($formData["serialized_condition"]);
        $event->setIndexEngineDriverConfigurationId($formData["index_engine_driver_configuration_id"]);

        return $event;
    }
178427
protected function getCreationEvent($formData)
    {
        $event = new IndexEngineDriverConfigurationEvent();

        $event->setCode($formData["code"]);
        $event->setDriverCode($formData["driver_code"]);
        $event->setTitle($formData["title"]);
        $event->setSerializedConfiguration($formData["serialized_configuration"]);

        return $event;
    }
174694
public function check_data($formdata) {
        $field = $this->_name;
        // Check if disable if options are set. if yes then don't add this..
        if (!empty($this->disableelements) && is_array($this->disableelements)) {
            foreach ($this->disableelements as $disableelement) {
                if (array_key_exists($disableelement, $formdata)) {
                    return false;
                }
            }
        }
        if (array_key_exists($field, $formdata) and $formdata->$field !== '') {
            return array('value' => (string)$formdata->$field);
        }
        return false;
    }
837166
protected function getCreationEvent($formData)
    {
        $orderStatusCreateEvent = new OrderStatusCreateEvent();

        $orderStatusCreateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setCode($formData['code'])
            ->setColor($formData['color'])
        ;

        return $orderStatusCreateEvent;
    }
496635
protected function doUpdate(array $entityData)
    {
        $user = $this->find($entityData['id']);

        return $this->populate($user, $entityData);
    }
1348804
public function validate(array $formData)
    {
        $this->validation = $this->validator->make($formData, $this->getValidationRules());

        if($this->validation->fails())
            throw new FormValidatorException('Validation failed', $this->getValidationErrors());
        return true;
    }
1030444
protected function getCreationEvent($formData)
    {
        $event = $this->getCreateOrUpdateEvent($formData);

        $customer = CustomerQuery::create()->findPk($this->getRequest()->get("customer_id"));

        $event->setCustomer($customer);

        return $event;
    }
457861
public function tryToLogin($formData)
    {
        $login    = array_key_exists($this->loginColumn, $formData) ? trim($formData[$this->loginColumn])
                : '';
        $password = array_key_exists($this->passwordColumn, $formData) ? trim($formData[$this->passwordColumn])
                : '';
        if (!$login) {
            $this->addStatusMessage(_('missing login'), 'error');

            return;
        }
        if (!$password) {
            $this->addStatusMessage(_('missing password'), 'error');

            return;
        }

        $result = $this->kontakt->authenticate($login, $password);
        if ($result === true) {
            $this->kontakt->defaultUrlParams['detail'] = 'full';
            $contactId                                 = $this->kontakt->loadFromFlexiBee([
                $this->loginColumn => $login]);
            if (is_array($contactId)) {
                $this->addStatusMessage(sprintf(_('Multiplete ContactID'),
                        serialize($contactId)), 'warning');
                $contactId = current($contactId);
                $this->addStatusMessage(_('Using the first one'));
            }

            $firma = $this->kontakt->getDataValue('firma');
            $this->adresar->loadFromFlexiBee(['id' => $firma]);

            $this->addStatusMessage($firma.' '.$this->adresar->getDataValue('nazev'));

            $result = $this->loginSuccess();
        }
        return $result;
    }
1047594
public function updateObjectState(
        ObjectStateUpdateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('update-object-state-%d', $data->getObjectState()->id);

        return $this->formFactory->createNamed($name, ObjectStateUpdateType::class, $data);
    }
1342393
private function normalizeActionFormData($formData)
    {
        if ($this->isNewEditObject() === true) {
            $formData['oxactions__oxid'] = null;
        }

        if (!$formData['oxactions__oxactive']) {
            $formData['oxactions__oxactive'] = 0;
        }

        return $formData;
    }
694086
public function createForm(FormEvent $event): void
    {
        $admin = $event->getAdmin();
        $action = $admin->getAction();
        $configuration = $action->getConfiguration();

        if (!$configuration->get('use_form')) {
            return;
        }
        $entity = null;

        if (LAGAdminBundle::LOAD_STRATEGY_UNIQUE === $configuration->get('load_strategy')) {
            if (!$admin->getEntities()->isEmpty()) {
                $entity = $admin->getEntities()->first();
            }
        }

        if ('create' === $action->getName() || 'edit' === $action->getName()) {
            $form = $this->adminFormFactory->createEntityForm($admin, $event->getRequest(), $entity);
            $event->addForm($form, 'entity');
        }

        if ('delete' === $action->getName()) {
            $form = $this->adminFormFactory->createDeleteForm($action, $event->getRequest(), $entity);
            $event->addForm($form, 'delete');
        }
    }
550645
protected function createFormGroup(array $data = null)
    {
        if (isset($data['type'])) {
            $type = $data['type'];
        } else {
            $type = $this->defaultGroupType();
        }

        $group = $this->formGroupFactory()->create($type);
        $group->setForm($this->formWidget());

        if ($data !== null) {
            $group->setData($data);
        }

        return $group;
    }
653448
public function doUpdate($data, $form)
    {
        foreach ($this->items as $cart_item) {
            foreach ($data as $key => $value) {
                $sliced_key = explode("_", $key);
                if ($sliced_key[0] == "Quantity") {
                    if (isset($cart_item) && ($cart_item->Key == $sliced_key[1])) {
                        try {
                            if ($value > 0) {
                                $this->update($cart_item->Key, $value);
                                
                                $this->setSessionMessage(
                                    "success",
                                    _t("Checkout.UpdatedShoppingCart", "Shopping cart updated")
                                );
                            } else {
                                $this->remove($cart_item->Key);
                                
                                $this->setSessionMessage(
                                    "success",
                                    _t("Checkout.EmptiedShoppingCart", "Shopping cart emptied")
                                );
                            }
                        } catch (ValidationException $e) {
                            $this->setSessionMessage(
                                "bad",
                                $e->getMessage()
                            );
                        } catch (Exception $e) {
                            $this->setSessionMessage(
                                "bad",
                                $e->getMessage()
                            );
                        }
                    }
                }
            }
        }

        $this->save();

        return $this->redirectBack();
    }
1289697
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        if ($this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
            $roles = [
                'User' => 'ROLE_USER',
                'Admin' => 'ROLE_ADMIN',
                'Super admin' => 'ROLE_SUPER_ADMIN',
            ];
            $form
                ->add(
                    'roles',
                    ChoiceType::class,
                    [
                        'label' => 'Roles',
                        'required' => true,
                        'expanded' => true,
                        'multiple' => true,
                        'choices' => $roles,
                    ]
                );
        }
    }
2272
public function doUpdate($data, $form)
    {
        try {
            foreach ($this->Items() as $item) {
                foreach ($data as $key => $value) {
                    $sliced_key = explode("_", $key);
                    if ($sliced_key[0] == "Quantity") {
                        if (isset($item) && ($item->Key == $sliced_key[1])) {
                            if ($value > 0) {
                                ShoppingCartFactory::create()->updateItem(
                                    $item,
                                    $value
                                );
                            } else {
                                $item->delete();
                            }

                            $form->sessionMessage(
                                _t("ShoppingCart.UpdatedShoppingCart", "Shopping cart updated"),
                                ValidationResult::TYPE_GOOD
                            );
                        }
                    }
                }
            }
            ShoppingCartFactory::create()->save();
        } catch (ValidationException $e) {
            $form->sessionMessage(
                $e->getMessage()
            );
        } catch (Exception $e) {
            $form->sessionMessage(
                $e->getMessage()
            );
        }
        
        return $this->redirectBack();
    }
1069572
protected function save_intro_draft_files($formdata) {
        if (isset($formdata->introattachments)) {
            file_save_draft_area_files($formdata->introattachments, $this->get_context()->id,
                                       'mod_assign', ASSIGN_INTROATTACHMENT_FILEAREA, 0);
        }
    }