src/FormHandler.php
public function handleRequest($request = null)
    {
        $this->submitted = true;

        $requestData = $this->requestHandler->handleRequest($this, $request);

        $validRequestData = $this->checkFieldsSubmitted($this->fields, $requestData);

        if ($this->submitted === true && !empty($validRequestData)) {
            $this->data = $validRequestData;
            $this->setRequiredFieldErrors();
        }
        else {
            $this->submitted = false;
        }

        if (isset($this->restoreDataHandler)) {
            if ($this->isSubmitted()) {
                $this->restoreDataHandler->setRestorableData($this, $this->data, $request);
            }
            else {
                $restoredData = $this->restoreDataHandler->restoreData($this, $request);

                if (is_array($restoredData) && !empty($restoredData)) {
                    $this->data = $restoredData;
                }
            }
        }

        if (isset($this->eventDispatcher)) {
            $event = new FormHandlerRequestEvent($this, $request, $this->data);
            $this->eventDispatcher->dispatch('form_handler.request', $event);
            $this->data = $event->getFormData();
        }
    }
public function handleRequest($request = null)
    {
        $this->submitted = true;

        $requestData = $this->requestHandler->handleRequest($this, $request);

        $validRequestData = $this->checkFieldsSubmitted($this->fields, $requestData);

        if ($this->submitted === true && !empty($validRequestData)) {
            $this->data = $validRequestData;
            $this->setRequiredFieldErrors();
        }
        else {
            $this->submitted = false;
        }

        if (isset($this->restoreDataHandler)) {
            if ($this->isSubmitted()) {
                $this->restoreDataHandler->setRestorableData($this, $this->data, $request);
            }
            else {
                $restoredData = $this->restoreDataHandler->restoreData($this, $request);

                if (is_array($restoredData) && !empty($restoredData)) {
                    $this->data = $restoredData;
                }
            }
        }

        if (isset($this->eventDispatcher)) {
            $event = new FormHandlerRequestEvent($this, $request, $this->data);
            $this->eventDispatcher->dispatch('form_handler.request', $event);
            $this->data = $event->getFormData();
        }
    }
public function handleRequest ( $ request = null ) { $ this -> submitted = true ; $ requestData = $ this -> requestHandler -> handleRequest ( $ this , $ request ) ; $ validRequestData = $ this -> checkFieldsSubmitted ( $ this -> fields , $ requestData ) ; if ( $ this -> submitted === true && ! empty ( $ validRequestData ) ) { $ this -> data = $ validRequestData ; $ this -> setRequiredFieldErrors ( ) ; } else { $ this -> submitted = false ; } if ( isset ( $ this -> restoreDataHandler ) ) { if ( $ this -> isSubmitted ( ) ) { $ this -> restoreDataHandler -> setRestorableData ( $ this , $ this -> data , $ request ) ; } else { $ restoredData = $ this -> restoreDataHandler -> restoreData ( $ this , $ request ) ; if ( is_array ( $ restoredData ) && ! empty ( $ restoredData ) ) { $ this -> data = $ restoredData ; } } } if ( isset ( $ this -> eventDispatcher ) ) { $ event = new FormHandlerRequestEvent ( $ this , $ request , $ this -> data ) ; $ this -> eventDispatcher -> dispatch ( 'form_handler.request' , $ event ) ; $ this -> data = $ event -> getFormData ( ) ; } }
Use a request handler to get data from a request and store the values that match fields
in the form blueprint

@param null $request
Use a request handler to get data from a request and store the values that match fields in the form blueprint