FOS\UserBundle\Form\UserForm::process PHP Method

process() public method

public process ( FOS\UserBundle\Model\UserInterface $user = null, $confirmation = null )
$user FOS\UserBundle\Model\UserInterface
    public function process(UserInterface $user = null, $confirmation = null)
    {
        if (null === $user) {
            $user = $this->userManager->createUser();
        }
        $this->setData($user);
        if ('POST' == $this->request->getMethod()) {
            $this->bind($this->request);
            if ($this->isValid()) {
                if (true === $confirmation) {
                    $user->setEnabled(false);
                } else {
                    if (false === $confirmation) {
                        $user->setConfirmationToken(null);
                        $user->setEnabled(true);
                    }
                }
                $this->userManager->updateUser($user);
                return true;
            }
        }
        return false;
    }