public function getByAuthCode(AuthCodeEntity $authCode)
    {
        $result = $this->getConnection()->table('oauth_sessions')
            ->select('oauth_sessions.*')
            ->join('oauth_auth_codes', 'oauth_sessions.id', '=', 'oauth_auth_codes.session_id')
            ->where('oauth_auth_codes.id', $authCode->getId())
            ->first();

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

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

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

        return (new SessionEntity($this->getServer()))
               ->setId($result->id)
               ->setOwner($result->owner_type, $result->owner_id);
    }
public function getByAuthCode ( AuthCodeEntity $ authCode ) { $ result = $ this -> getConnection ( ) -> table ( 'oauth_sessions' ) -> select ( 'oauth_sessions.*' ) -> join ( 'oauth_auth_codes' , 'oauth_sessions.id' , '=' , 'oauth_auth_codes.session_id' ) -> where ( 'oauth_auth_codes.id' , $ authCode -> 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 auth code.

@param \League\OAuth2\Server\Entity\AuthCodeEntity $authCode The auth code

@return \League\OAuth2\Server\Entity\SessionEntity
Get a session from an auth code .