本文整理匯總了PHP中League\OAuth2\Server\Entity\AccessTokenEntity::getSession方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessTokenEntity::getSession方法的具體用法?PHP AccessTokenEntity::getSession怎麽用?PHP AccessTokenEntity::getSession使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類League\OAuth2\Server\Entity\AccessTokenEntity
的用法示例。
在下文中一共展示了AccessTokenEntity::getSession方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resolveResourceOwner
/**
* Resolve the resource owner.
*
* @param \League\OAuth2\Server\Entity\AccessTokenEntity $token
*
* @return mixed
*/
protected function resolveResourceOwner(AccessTokenEntity $token)
{
$session = $token->getSession();
if ($session->getOwnerType() == 'client') {
return call_user_func($this->clientResolver, $session->getOwnerId());
}
return call_user_func($this->userResolver, $session->getOwnerId());
}
示例2:
function it_returns_the_client_id(ResourceServer $checker, AccessTokenEntity $accessTokenEntity, SessionEntity $sessionEntity, ClientEntity $clientEntity)
{
$clientEntity->getId()->willReturn('1')->shouldBeCalled();
$sessionEntity->getClient()->willReturn($clientEntity)->shouldBeCalled();
$accessTokenEntity->getSession()->willReturn($sessionEntity)->shouldBeCalled();
$checker->getAccessToken()->willReturn($accessTokenEntity)->shouldBeCalled();
$this->getClientId()->shouldReturn('1');
}