Symfony\Component\Form\Form::get PHP Method

get() public method

Returns the child with the given name.
public get ( string $name ) : Symfony\Component\Form\FormInterface
$name string
return Symfony\Component\Form\FormInterface
    public function get($name)
    {
        if (isset($this->children[$name])) {

            return $this->children[$name];
        }

        throw new \InvalidArgumentException(sprintf('Field "%s" does not exist.', $name));
    }

Usage Example

Beispiel #1
1
 /**
  * {@inheritdoc}
  */
 public function process(Request $request, $grantType = 'password')
 {
     $account = $this->records->getAccountByEmail($this->submittedForm->get('email')->getData());
     if (!$account) {
         return null;
     }
     $oauth = $this->records->getOauthByGuid($account->getGuid());
     $requestPassword = $this->submittedForm->get('password')->getData();
     if ($this->isValidPassword($oauth, $requestPassword) === false) {
         return null;
     }
     $accessToken = $this->provider->getAccessToken('password', ['guid' => $account->getGuid()]);
     $this->session->addAccessToken('local', $accessToken)->createAuthorisation($account->getGuid());
     $request->query->set('code', Uuid::uuid4()->toString());
     try {
         parent::process($request, $grantType);
         $this->finish($request);
         $this->feedback->info('Login successful.');
     } catch (DisabledAccountException $ex) {
         $this->session->addRedirect($this->urlGenerator->generate('authenticationLogin'));
         if ($this->session->getAuthorisation()) {
             $this->dispatchEvent(MembersEvents::MEMBER_LOGIN_FAILED_ACCOUNT_DISABLED, $this->session->getAuthorisation());
         }
     }
     return $this->session->popRedirect()->getResponse();
 }
All Usage Examples Of Symfony\Component\Form\Form::get