protected function createREST($first, $last = null, $api_url = self::API_URL)
    {
        if ($first instanceof OAuthToken) {
            $rest = new REST(array(
                'server' => $api_url,
                'debug_mode' => $this->debug_mode
            ));
            $auth = $first->getTokenType() . ' ' . $first->getAccessToken();
            $rest->setHeader('Authorization', $auth);

            return $rest;
        }

        return new REST(array(
            'server' => $api_url,
            'user'   => $first,
            'pass'   => $last,
            'debug_mode' => $this->debug_mode
        ));
    }
protected function createREST($first, $last = null, $api_url = self::API_URL)
    {
        if ($first instanceof OAuthToken) {
            $rest = new REST(array(
                'server' => $api_url,
                'debug_mode' => $this->debug_mode
            ));
            $auth = $first->getTokenType() . ' ' . $first->getAccessToken();
            $rest->setHeader('Authorization', $auth);

            return $rest;
        }

        return new REST(array(
            'server' => $api_url,
            'user'   => $first,
            'pass'   => $last,
            'debug_mode' => $this->debug_mode
        ));
    }
protected function createREST ( $ first , $ last = null , $ api_url = self :: API_URL ) { if ( $ first instanceof OAuthToken ) { $ rest = new REST ( array ( 'server' => $ api_url , 'debug_mode' => $ this -> debug_mode ) ) ; $ auth = $ first -> getTokenType ( ) . ' ' . $ first -> getAccessToken ( ) ; $ rest -> setHeader ( 'Authorization' , $ auth ) ; return $ rest ; } return new REST ( array ( 'server' => $ api_url , 'user' => $ first , 'pass' => $ last , 'debug_mode' => $ this -> debug_mode ) ) ; }
Creates REST object

@param  mixed $first email address or apikey or OAuthToken
@param  string $last Null if using apikey or OAuthToken
@return REST
@ignore
Creates REST object