Retrieves data from the form data
@param object $formdata data submited with the form
@return mixed array filter data or false when filter not set
767898
public function check_data($formdata) {
        $profilefields = $this->get_profile_fields();

        if (empty($profilefields)) {
            return false;
        }

        $field    = $this->_name;
        $operator = $field.'_op';
        $profile  = $field.'_fld';

        if (array_key_exists($profile, $formdata)) {
            if ($formdata->$operator < 5 and $formdata->$field === '') {
                return false;
            }

            return array('value'    => (string)$formdata->$field,
                         'operator' => (int)$formdata->$operator,
                         'profile'  => (int)$formdata->$profile);
        }
    }
1065579
public function getImageData($imageFormat = 'png')
    {
        $renderer = $this->getRenderer($imageFormat);
        $this->draw($renderer, $this->getIconBounds());
        return $renderer->getData();
    }
480591
protected function getCreationEvent($formData)
    {
        $brandCreateEvent = new BrandCreateEvent();

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

        return $brandCreateEvent;
    }
344728
protected function retrieveData($data)
    {
        $filter = $this->getInputFilter();

        if (null !== $filter) {
            return $filter->getValues();
        }

        return (array)$data;
    }
478860
public function getData() {
        $values = array_filter(filter_input_array(INPUT_POST));
        foreach ($values as $key => $value) {
            if ( is_array($value) )  {
                $values[$key] = array_filter($value);
            }
        }

        return $values + $_FILES;
    }
1278368
public function getForm(ModelInterface $formData = null, $method = 'POST')
    {
        if (!$this->crud) {
            throw new RuntimeException(sprintf('You must call "setCrud()" before call this method'));
        }

        $formClass = $this->crud->getForm();

        if (class_exists($formClass)) {
            $formObject = new $formClass();
        } else {
            $formObject = $this->container->get($formClass);
        }

        $builder = $this->formFactory->createBuilder(get_class($formObject));
        $builder->setMethod($method);

        $form = $builder->getForm();
        $form->setData($formData);

        return $form;
    }
552422
protected function _getFilterData()
    {
        $rawFilterData = $this->request->getData();
        $filterData = [];
        foreach ($this->filterFields as $filterField => $options) {
            if (isset($rawFilterData[$filterField]) && $rawFilterData[$filterField] !== '') {
                $filterData[$filterField] = $rawFilterData[$filterField];
            }
        }

        return $filterData;
    }
1126443
public function validate(array $requestData)
    {
        $ourData = Hash::extract($requestData, $this->getInputName());

        foreach ($this->getAttributeNames() as $name) {

            $validations = $this->extractNormalizedValidations($name);
            foreach ($validations as $validationKey => $validatorConfig) {

                $validator = Validator::factory($validationKey);
                $validator->configure($validatorConfig);
                $validator->init();

                if (!array_key_exists($name, $ourData) || !$validator->test($ourData[$name], $this)) {
                    $this->setValidationError($name, $validationKey, $validator->getMessage());
                }
            }
        }

        return !$this->hasValidationErrors();
    }
1218355
public function search($params, $formName = null)
    {
        $query = DpAdminMenuUrlRule::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params, $formName);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'rule_id' => $this->rule_id,
            'url_id' => $this->url_id,
            'status' => $this->status,
        ]);

        $query->andFilterWhere(['like', 'param_name', $this->param_name])
            ->andFilterWhere(['like', 'rule', $this->rule])
            ->andFilterWhere(['like', 'note', $this->note]);

        return $dataProvider;
    }
53721
public function submission($formData)
    {
        if ($form_settings = $this->_block->getContent(true)) {
            $form_settings = $this->_defaultData($form_settings);
            $form_rules = BlockFormRule::get_rules($form_settings->template ?: $this->_block->name);
            $v = Validator::make($formData, $form_rules);
            $captcha = Securimage::captchaCheck();

            // check form rules
            if ($v->passes() && !($form_settings->captcha && !$captcha)) {
                // delete blank and system fields
                unset($formData['captcha_code']);

                // Save data function (override this function to save data differently)
                $form_submission = $this->submissionSaveData($formData);
                if (!$form_submission->id) {
                    FormMessage::add('submission_save_error', 'Unable to save the form.');
                }

                // Send email
                if ($this->submissionSendEmail(unserialize($form_submission->content), $form_settings)) {
                    $form_submission->sent = 1;
                    $form_submission->save();
                }

                Session::put('form_data', $form_submission);
                return \redirect(PageBuilder::pageUrl($form_settings->page_to));
            } else {
                FormMessage::set($v->messages());
                if (!$captcha && $form_settings->captcha) {
                    FormMessage::add('captcha_code', 'Invalid Captcha Code, try again.');
                }
            }

        } else {
            return Response::make('No form settings found, try saving the form block in the admin.', 500);
        }

        return false;
    }
472906
public function getFormData($field = null)
    {
        $filters = session('bzarzuela.filters');

        if (isset($filters[$this->key]['form_data'])) {

            if (! is_null($field)) {

                if (! isset($filters[$this->key]['form_data'][$field])) {
                    return null;
                }

                return $filters[$this->key]['form_data'][$field];
            }

            return $filters[$this->key]['form_data'];
        }

        if (! is_null($field)) {
            return null;
        }

        return [];
    }
1083653
public function getData($search = false) {
        if ($this->option && method_exists($this->form, $this->option)) {
            return $this->form->{$this->option}(...[$search]);
        }

        return [];
    }
1057284
public static function hydrateLayoutConfigFlexFormData($flexFormData): array
    {
        $dataStructure = $flexFormData;
        if (is_string($flexFormData)) {
            $dataStructure = GeneralUtility::xml2array($flexFormData);
        }

        // Level: FlexForm Sheets
        return array_map(function ($sheet) {
            // Level: FlexForm Sheet Fields
            return array_map(function ($field) {
                // Level: FlexForm Field
                return $field['vDEF'];
            }, $sheet['lDEF']);
        }, $dataStructure['data']);
    }
213640
protected function loadData()
    {
        if (is_null($this->filteredData)) {
            $this->filteredData = $this->filterHelper->filterData(
                $this->data,
                $this->filters,
                FilterInterface::FILTER_LOGIC_OR
            );

            if (!is_null($this->sort)) {
                $sort = $this->sort;
                uasort($this->filteredData, function ($a, $b) use ($sort) {
                    if (is_numeric($a[$sort[0]])) {
                        $comp = ($a[$sort[0]] < $b[$sort[0]]) ? -1 : 1;
                    } else {
                        $comp = (strcmp($a[$sort[0]], $b[$sort[0]]));
                    }

                    if ($sort[1] == "DESC") {
                        return -1 * $comp;
                    } else {
                        return $comp;
                    }

                });
            }
        }
    }
758983
public function submitForm($buttonText, $formData = [])
    {
        foreach ($formData as $name => $value) {
            // Weird, but that's what you gotta do. :)
            $value = ['value' => [$value]];

            $element = $this->findByNameOrId($name);
            $tag = $element->name();

            if ($tag == 'input' && $element->attribute('type') == 'checkbox') {
                $element->click();
            } else {
                $element->postValue($value);
            }
        }

        $this->findByValue($buttonText)->submit();

        $this->updateCurrentUrl();

        return $this;
    }
857867
protected function getUpdateEvent($formData)
    {
        $event = new AreaUpdateEvent();

        $this->hydrateEvent($event, $formData);

        $event->setAreaId($formData['area_id']);

        return $event;
    }
11895
protected function getStatusIndexesToUpdate(array $statusCollection, array $formData)
    {
        $formStatuses = $formData['statuses'];
        $originalStatusesMap = $this->generateStatusesPropertiesMap($statusCollection);

        $newPropertiesIndexes = $this->getStatusIndexesWithNewProperty($originalStatusesMap, $formStatuses);
        $lostPropertiesIndexes = $this->getStatusIndexesWithLostProperty($originalStatusesMap, $formStatuses);

        return array_unique(array_merge($newPropertiesIndexes, $lostPropertiesIndexes));
    }