本文整理汇总了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');
}