public function getByAccessToken(AccessTokenEntity $accessToken)
    {
        $result = $this->getConnection()->table('oauth_sessions')
                ->select('oauth_sessions.*')
                ->join('oauth_access_tokens', 'oauth_sessions.id', '=', 'oauth_access_tokens.session_id')
                ->where('oauth_access_tokens.id', $accessToken->getId())
                ->first();

        if (is_null($result)) {
            return;
        }

        return (new SessionEntity($this->getServer()))
               ->setId($result->id)
               ->setOwner($result->owner_type, $result->owner_id);
    }
public function getByAccessToken(AccessTokenEntity $accessToken)
    {
        $result = $this->getConnection()->table('oauth_sessions')
                ->select('oauth_sessions.*')
                ->join('oauth_access_tokens', 'oauth_sessions.id', '=', 'oauth_access_tokens.session_id')
                ->where('oauth_access_tokens.id', $accessToken->getId())
                ->first();

        if (is_null($result)) {
            return;
        }

        return (new SessionEntity($this->getServer()))
               ->setId($result->id)
               ->setOwner($result->owner_type, $result->owner_id);
    }
public function getByAccessToken ( AccessTokenEntity $ accessToken ) { $ result = $ this -> getConnection ( ) -> table ( 'oauth_sessions' ) -> select ( 'oauth_sessions.*' ) -> join ( 'oauth_access_tokens' , 'oauth_sessions.id' , '=' , 'oauth_access_tokens.session_id' ) -> where ( 'oauth_access_tokens.id' , $ accessToken -> getId ( ) ) -> first ( ) ; if ( is_null ( $ result ) ) { return ; } return ( new SessionEntity ( $ this -> getServer ( ) ) ) -> setId ( $ result -> id ) -> setOwner ( $ result -> owner_type , $ result -> owner_id ) ; }
Get a session from an access token.

@param \League\OAuth2\Server\Entity\AccessTokenEntity $accessToken The access token

@return \League\OAuth2\Server\Entity\SessionEntity
Get a session from an access token .