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
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;
    }
538672
protected function getUpdateEvent($formData)
    {
        $updateEvent = new FolderUpdateEvent($formData['id']);

        $updateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setChapo($formData['chapo'])
            ->setDescription($formData['description'])
            ->setPostscriptum($formData['postscriptum'])
            ->setVisible($formData['visible'])
            ->setParent($formData['parent'])
        ;

        return $updateEvent;
    }
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;
    }
781681
public function index(FormData $formData, $properties)
    {
        $id = $this->persistenceManager->getIdentifierByObject($formData);
        $formValues = json_decode($formData->getFormValues(), true);
        $formValues['_date'] = $formData->getDate();
        $data = $this->parseData($formValues, $properties);
        $index = $this->getIndex();
        $type = $this->getType($index, $formData->getFormIdentifier(), $properties);
        $document = new Document($type, $data, $id);
        $document->store();
    }
1306320
public static function & GetById ($formId) {
		if (isset(self::$instances[$formId])) {
			return self::$instances[$formId];
		} else {
			throw new \RuntimeException(
				'No form instance exists under form id `'.$formId.'`.'
				. ' Check if searched form instance has been already initialized'
				. ' or if form id has been already set.'
			);
		}
	}
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;
    }
1195289
protected function build_limitcourseids(\stdClass $formdata) {
        $limitcourseids = false;

        if (!empty($formdata->mycoursesonly)) {
            $limitcourseids = array_keys($this->get_my_courses(false));
        }

        if (!empty($formdata->courseids)) {
            if (empty($limitcourseids)) {
                $limitcourseids = $formdata->courseids;
            } else {
                $limitcourseids = array_intersect($limitcourseids, $formdata->courseids);
            }
        }

        return $limitcourseids;
    }
838719
protected function getUpdateEvent($formData)
    {
        $event = new IndexEngineIndexEvent();

        $transformer = new IndexMappingTransformer();

        $event->setId($formData["id"]);
        $event->setCode($formData["code"]);
        $event->setTitle($formData["title"]);
        $event->setType($formData["type"]);
        $event->setEntity($formData["entity"]);
        $event->setIndexEngineDriverConfigurationId($formData["index_engine_driver_configuration_id"]);
        $event->setConditions($formData["conditions"]);
        $event->setColumns($formData["columns"]);
        $event->setMapping($transformer->reverseTransform($formData["mapping"]));

        return $event;
    }
1130526
protected function fillForm($buttonText, $formData = [])
    {
        if (! is_string($buttonText)) {
            $formData = $buttonText;
            $buttonText = null;
        }

        return $this->getForm($buttonText)->setValues($formData);
    }
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;
    }
1047813
public function check_data($formdata) {
        $sdt = $this->_name.'_sdt';
        $edt = $this->_name.'_edt';

        if (!$formdata->$sdt and !$formdata->$edt) {
            return false;
        }

        $data = array();
        $data['after'] = $formdata->$sdt;
        $data['before'] = $formdata->$edt;

        return $data;
    }
324945
protected function getUpdateEvent($formData)
    {
        $orderStatusUpdateEvent = new OrderStatusUpdateEvent($formData['id']);

        $orderStatusUpdateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setChapo($formData['chapo'])
            ->setDescription($formData['description'])
            ->setPostscriptum($formData['postscriptum'])
            ->setCode($formData['code'])
            ->setColor($formData['color'])
         ;

        return $orderStatusUpdateEvent;
    }
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;
                    }

                });
            }
        }
    }
695398
public static function filterData($objectData, $filters = array())
    {
        $result = array();
        $listFilters = array();

        //====================================================================//
        // Process All Single Fields Ids & Store Sorted List Fields Ids
        foreach ($filters as $fieldId) {
            //====================================================================//
            // Explode List Field Id
            $isList = self::isListField($fieldId);
            //====================================================================//
            // Single Field Data Type
            if ((!$isList) && (array_key_exists($fieldId, $objectData))) {
                $result[$fieldId] = $objectData[$fieldId];
            } elseif (!$isList) {
                continue;
            }
            //====================================================================//
            // List Field Data Type
            $listName = $isList['listname'];
            $fieldName = $isList['fieldname'];
            //====================================================================//
            // Check List Data are Present in Block
            if (!array_key_exists($listName, $objectData)) {
                continue;
            }
            //====================================================================//
            // Create List
            if (!array_key_exists($listName, $listFilters)) {
                $listFilters[$listName] = array();
            }
            $listFilters[$listName][] = $fieldName;
        }

        //====================================================================//
        // Process All List Fields Ids Filters
        foreach ($listFilters as $listName => $listFilters) {
            $result[$listName] = self::filterListData($objectData[$listName], $listFilters);
        }

        return $result;
    }
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();
    }
499185
public function load($data, $formName = null)
    {
        return $this->_isDataLoaded ?: $this->_isDataLoaded=true && parent::load($data, $formName);
    }
1173205
public function check_data($formdata) {
        $field    = $this->_name;
        $role     = $field .'_rl';
        $category = $field .'_ct';

        if (array_key_exists($field, $formdata)) {
            if (empty($formdata->$field) and empty($formdata->$role) and empty($formdata->$category)) {
                // Nothing selected.
                return false;
            }
            return array('value'      => (string)$formdata->$field,
                         'roleid'     => (int)$formdata->$role,
                         'categoryid' => (int)$formdata->$category);
        }
        return false;
    }