/**
  * @inheritdoc
  */
 public function getByAccessToken(AccessTokenEntity $entity)
 {
     $accessToken = AccessToken::findByToken($entity->getId());
     /** @var Session $session */
     $session = Session::find($accessToken->sessionId);
     if ($session === null) {
         throw new SessionNotFound();
     }
     return $this->createEntity($session);
 }
Exemplo n.º 2
0
 /**
  * @param int $sessionId
  *
  * @return Client
  */
 public static function findBySessionId($sessionId)
 {
     $session = Session::find($sessionId);
     return self::find($session->getAttribute('clientId'));
 }