/** * @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); }
/** * @param int $sessionId * * @return Client */ public static function findBySessionId($sessionId) { $session = Session::find($sessionId); return self::find($session->getAttribute('clientId')); }