src/Ingewikkeld/Rest/UserBundle/ResourceMapper/User.php
public function populateResourceWithForm(Resource $resource, FormInterface $form)
    {
        $formData = $form->getData();

        $resource->setData(
            array(
                'username' => $formData['username'],
                'email'    => $formData['email']
            )
        );
    }
public function populateResourceWithForm(Resource $resource, FormInterface $form)
    {
        $formData = $form->getData();

        $resource->setData(
            array(
                'username' => $formData['username'],
                'email'    => $formData['email']
            )
        );
    }
public function populateResourceWithForm ( Resource $ resource , FormInterface $ form ) { $ formData = $ form -> getData ( ) ; $ resource -> setData ( array ( 'username' => $ formData [ 'username' ] , 'email' => $ formData [ 'email' ] ) ) ; }
Populates the given resource with the values in the form; overwriting any existing items.

@param \Hal\Resource $resource
@param FormInterface $form

@return void
Populates the given resource with the values in the form ; overwriting any existing items .