src/Ingewikkeld/Rest/ResourceBundle/Resource/Controller.php
protected function validateRequestParameters(Request $request)
    {
        $data = $request->request->all();
        if (isset($data['id'])) {
            unset($data['id']);
        }

        // we explicitly do not load existing data; an edit is a PUT and should supply all valid data!
        $this->form->submit($data);
        if (!$this->form->isValid()) {
            throw new BadRequestHttpException($this->form->getErrorsAsString());
        }

        return $this->form;
    }
protected function validateRequestParameters(Request $request)
    {
        $data = $request->request->all();
        if (isset($data['id'])) {
            unset($data['id']);
        }

        // we explicitly do not load existing data; an edit is a PUT and should supply all valid data!
        $this->form->submit($data);
        if (!$this->form->isValid()) {
            throw new BadRequestHttpException($this->form->getErrorsAsString());
        }

        return $this->form;
    }
protected function validateRequestParameters ( Request $ request ) { $ data = $ request -> request -> all ( ) ; if ( isset ( $ data [ 'id' ] ) ) { unset ( $ data [ 'id' ] ) ; } // we explicitly do not load existing data; an edit is a PUT and should supply all valid data! $ this -> form -> submit ( $ data ) ; if ( ! $ this -> form -> isValid ( ) ) { throw new BadRequestHttpException ( $ this -> form -> getErrorsAsString ( ) ) ; } return $ this -> form ; }
Takes the request parameters and passes them through the form associated with this controller.

@param Request $request

@throws BadRequestHttpException if the request parameters could not be validated with the form.

@return FormInterface
Takes the request parameters and passes them through the form associated with this controller .