本文整理匯總了PHP中HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface::getDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserResponseInterface::getDisplayName方法的具體用法?PHP UserResponseInterface::getDisplayName怎麽用?PHP UserResponseInterface::getDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
的用法示例。
在下文中一共展示了UserResponseInterface::getDisplayName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: process
/**
* Processes the form for a given request.
*
* @param Request $request Active request
* @param Form $form Form to process
* @param UserResponseInterface $userInformation OAuth response
*
* @return boolean True if the processing was successful
*/
public function process(Request $request, Form $form, UserResponseInterface $userInformation)
{
$formHandler = $this->reconstructFormHandler($request, $form);
// make FOSUB process the form already
$processed = $formHandler->process();
// if the form is not posted we'll try to set some properties
if ('POST' !== $request->getMethod()) {
$user = $form->getData();
$user->setUsername($this->getUniqueUsername($userInformation->getDisplayName()));
if ($userInformation instanceof AdvancedUserResponseInterface) {
$user->setEmail($userInformation->getEmail());
}
$form->setData($user);
}
return $processed;
}