public function get($code)
    {
        $result = $this->getConnection()->table('oauth_auth_codes')
            ->where('oauth_auth_codes.id', $code)
            ->where('oauth_auth_codes.expire_time', '>=', time())
            ->first();

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

        return (new AuthCodeEntity($this->getServer()))
            ->setId($result->id)
            ->setRedirectUri($result->redirect_uri)
            ->setExpireTime((int) $result->expire_time);
    }
public function get($code)
    {
        $result = $this->getConnection()->table('oauth_auth_codes')
            ->where('oauth_auth_codes.id', $code)
            ->where('oauth_auth_codes.expire_time', '>=', time())
            ->first();

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

        return (new AuthCodeEntity($this->getServer()))
            ->setId($result->id)
            ->setRedirectUri($result->redirect_uri)
            ->setExpireTime((int) $result->expire_time);
    }
public function get ( $ code ) { $ result = $ this -> getConnection ( ) -> table ( 'oauth_auth_codes' ) -> where ( 'oauth_auth_codes.id' , $ code ) -> where ( 'oauth_auth_codes.expire_time' , '>=' , time ( ) ) -> first ( ) ; if ( is_null ( $ result ) ) { return ; } return ( new AuthCodeEntity ( $ this -> getServer ( ) ) ) -> setId ( $ result -> id ) -> setRedirectUri ( $ result -> redirect_uri ) -> setExpireTime ( ( int ) $ result -> expire_time ) ; }
Get the auth code.

@param  string $code

@return \League\OAuth2\Server\Entity\AuthCodeEntity
Get the auth code .