It process the submitted form data and store the form data using given form name.

The model attributes will be set by the parent class.

@param array $data
@param string $formName
@return boolean
179411
public function load( $data, $formName = null ) {

		if( isset( $formName ) && isset( $data[ $formName ] ) ) {

			$this->data	= $data[ $formName ];
		}

		return parent::load( $data, $formName );
	}
992886
protected final function validateUpdateData(array $data = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if ($this->rules) {
			$newRules = [];
			foreach ($data as $key => $v) {
				if (isset($this->rules[ $key ])) {
					$newRules[ $key ] = $this->rules[ $key ];
				}
			}
			if ($newRules) {
				return $this->validateData($newRules, $data);
			}
		}

		return true;
	}
160871
public function bind($data)
	{
		// Make sure there is a valid Form XML document.
		if (!($this->xml instanceof SimpleXMLElement))
		{
			return false;
		}

		// The data must be an object or array.
		if (!is_object($data) && !is_array($data))
		{
			return false;
		}

		// Convert the input to an array.
		if (is_object($data))
		{
			if ($data instanceof Registry)
			{
				// Handle a Registry.
				$data = $data->toArray();
			}
			elseif ($data instanceof Obj)
			{
				// Handle a Object.
				$data = $data->getProperties();
			}
			else
			{
				// Handle other types of objects.
				$data = (array) $data;
			}
		}

		// Process the input data.
		foreach ($data as $k => $v)
		{
			if ($this->findField($k))
			{
				// If the field exists set the value.
				$this->data->set($k, $v);
			}
			elseif (is_object($v) || Arr::isAssociative($v))
			{
				// If the value is an object or an associative array hand it off to the recursive bind level method.
				$this->bindLevel($k, $v);
			}
		}

		return true;
	}
416585
protected final function validateNewData(array $data = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if ($this->rules) {
			return $this->validateData($this->rules, $data);
		}

		return true;
	}
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;
    }
396935
public function createFormErrorArray(Form $data)
    {
        $form = [];
        $errors = [];
        foreach ($data->getErrors() as $error) {
            $errors[] = $this->getErrorMessage($error);
        }

        if ($errors) {
            $form['errors'] = $errors;
        }

        $children = [];
        foreach ($data->all() as $child) {
            if ($child instanceof Form) {
                $children[$child->getName()] = $this->createFormErrorArray($child);
            }
        }

        if ($children) {
            $form['children'] = $children;
        }

        return $form;
    }
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;
    }
888972
public function postSubmit(FormEvent $event)
    {
        $data = $event->getData();

        if ($this->itemDataClass !== null) {
            $itemMetadata = $this->getClassMetadata($this->itemDataClass);
            if ($itemMetadata !== null) {
                $this->cleanupCollection($data, $itemMetadata);
            }
        }
    }
1300944
public function process($formdata, $data = null)
    {
        parent::process($formdata, $data);
        $this->current_token = $this->csrf_impl->generateCSRFToken($this);
    }
300152
public static function upload($form_name = 'img', $multiple = false, $data = [])
    {
        $model = new UploadImgForm();
        if ($multiple == false) {
            return $model->doUploadSingle($form_name, $data);
        } else {
            return $model->doUploadMultiple($form_name, $data);
        }
    }
84522
public function validate($formData)
	{
		$formData = $this->normalizeFormData($formData);

		$this->validation = $this->validator->make(
			$formData,
			$this->getValidationRules(),
			$this->getValidationMessages()
		);

		if ($this->validation->fails())
		{
			throw new FormValidationException('Validation failed', $this->getValidationErrors());
		}

		return true;
	}
777028
public function onFlash($eventName, array $data)
    {
        $this->validateEventData($data);

        list($notification, $notificationBag, $message) = $data;

        $key = implode('.', [$this->key, $notificationBag->getName()]);

        $this->session->push($key, $message);

        return true;
    }
1336626
public function add(array $post, Form $form = null)
    {
        $model  = $this->getModel();
        $form   = ($form instanceof Form) ?
            $form->setData($post) :
            $this->prepareForm($model, $post, true, true);
        $argv   = compact('post', 'form');
        $argv   = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_PRE_ADD, $this, $argv);

        if (!$form->isValid()) {
            return $form;
        }

        $saved  = $this->save($form->getData());
        $argv   = compact('post', 'form', 'saved');
        $argv   = $this->prepareEventArguments($argv);

        $this->getEventManager()->trigger(self::EVENT_POST_ADD, $this, $argv);

        return $saved;
    }
786162
protected function validateData($data): void
    {
        if ($data instanceof FormInterface) {
            $data = $data->getData();
        }

        if (!\is_object($data)) {
            throw new UnexpectedTypeException($data, 'object');
        }
    }
70780
public function preSubmit(FormEvent $event)
    {
        $form = $event->getForm();
        $data = $form->getData();

        if (is_array($event->getData())) {
            $order = array_flip(array_keys($event->getData()));
            if (is_null($data)) {
                $data = array();
            }

            if ($data instanceof Collection) {
                $dataClone = $data->toArray();
                $data->clear();
                foreach ($order as $key => $value) {
                    $data->set($key, array_key_exists($key, $dataClone) ? $dataClone[$key] : null);
                }
            } elseif (is_array($data)) {
                $oldData = array_merge(array(), $data);
                $data = array();
                foreach ($order as $key => $value) {
                    $data[$key] = array_key_exists($key, $oldData) ? $oldData[$key] : null;
                }

            }
            $form->setData($data);
        }
    }
459014
public function save($data, $form)
    {
        $className = $this->config()->get('tree_class');

        // Existing or new record?
        $id = $data['ID'];
        if (substr($id, 0, 3) != 'new') {
            /** @var SiteTree $record */
            $record = DataObject::get_by_id($className, $id);
            // Check edit permissions
            if ($record && !$record->canEdit()) {
                return Security::permissionFailure($this);
            }
            if (!$record || !$record->ID) {
                throw new HTTPResponse_Exception("Bad record ID #$id", 404);
            }
        } else {
            if (!$className::singleton()->canCreate()) {
                return Security::permissionFailure($this);
            }
            $record = $this->getNewItem($id, false);
        }

        // Check publishing permissions
        $doPublish = !empty($data['publish']);
        if ($record && $doPublish && !$record->canPublish()) {
            return Security::permissionFailure($this);
        }

        // TODO Coupling to SiteTree
        $record->HasBrokenLink = 0;
        $record->HasBrokenFile = 0;

        if (!$record->ObsoleteClassName) {
            $record->writeWithoutVersion();
        }

        // Update the class instance if necessary
        if (isset($data['ClassName']) && $data['ClassName'] != $record->ClassName) {
            // Replace $record with a new instance of the new class
            $newClassName = $data['ClassName'];
            $record = $record->newClassInstance($newClassName);
        }

        // save form data into record
        $form->saveInto($record);
        $record->write();

        // If the 'Publish' button was clicked, also publish the page
        if ($doPublish) {
            $record->publishRecursive();
            $message = _t(
                __CLASS__ . '.PUBLISHED',
                "Published '{title}' successfully.",
                ['title' => $record->Title]
            );
        } else {
            $message = _t(
                __CLASS__ . '.SAVED',
                "Saved '{title}' successfully.",
                ['title' => $record->Title]
            );
        }

        $this->getResponse()->addHeader('X-Status', rawurlencode($message));
        return $this->getResponseNegotiator()->respond($this->getRequest());
    }
242407
public function submitreview($data, $form) {
		$registration = $this->getCurrentRegistration();
		$form->saveInto($registration);

		//save registrant data if selected attendee
		$registrantid = isset($data['RegistrantAttendeeID']) ? (int)$data['RegistrantAttendeeID'] : null;
		if($registrantid && $attendee = $registration->Attendees()->byID($registrantid)) {
			$registrantData = array();
			foreach ($registration->stat('registrant_fields') as $field) {
				$registrantData[$field] = $attendee->$field;
			};
			$registration->update($registrantData);
		}
		
		$registration->calculateTotal(); // final calculation
		$registration->write();
		//redirect to appropriate place, based on total cost
		$action = $registration->canPay() ? 'payment' : 'complete';
		return $this->redirect($this->Link($action));
	}