public function fetchItems($r = true){
        $this->prepareToken();
        
        $url = $this->urlbase.$this->urlbranch;
        
        $query = $this->genQuery();
        
        $path = $this->options['Action'].'Result';
        if ($this->mockMode){
           $xml = $this->fetchMockFile()->$path;
        } else {
            $response = $this->sendRequest($url, array('Post'=>$query));
            
            if (!$this->checkResponse($response)){
                return false;
            }
            
            $xml = simplexml_load_string($response['body'])->$path;
        }
        
        if (is_null($xml->AmazonOrderId)){
            $this->log("You just got throttled.",'Warning');
            return false;
        }
        $this->orderId = (string)$xml->AmazonOrderId;
        if (!empty($this->options['AmazonOrderId']) && $this->options['AmazonOrderId'] != $this->orderId){
            $this->log('You grabbed the wrong Order\'s items! - '.$this->options['AmazonOrderId'].' =/= '.$this->orderId,'Urgent');
        }
        
        $this->parseXML($xml->OrderItems);
        
        $this->checkToken($xml);
        
        if ($this->tokenFlag && $this->tokenUseFlag && $r === true){
            while ($this->tokenFlag){
                $this->log("Recursively fetching more items");
                $this->fetchItems(false);
            }
        }
    }
public function fetchItems($r = true){
        $this->prepareToken();
        
        $url = $this->urlbase.$this->urlbranch;
        
        $query = $this->genQuery();
        
        $path = $this->options['Action'].'Result';
        if ($this->mockMode){
           $xml = $this->fetchMockFile()->$path;
        } else {
            $response = $this->sendRequest($url, array('Post'=>$query));
            
            if (!$this->checkResponse($response)){
                return false;
            }
            
            $xml = simplexml_load_string($response['body'])->$path;
        }
        
        if (is_null($xml->AmazonOrderId)){
            $this->log("You just got throttled.",'Warning');
            return false;
        }
        $this->orderId = (string)$xml->AmazonOrderId;
        if (!empty($this->options['AmazonOrderId']) && $this->options['AmazonOrderId'] != $this->orderId){
            $this->log('You grabbed the wrong Order\'s items! - '.$this->options['AmazonOrderId'].' =/= '.$this->orderId,'Urgent');
        }
        
        $this->parseXML($xml->OrderItems);
        
        $this->checkToken($xml);
        
        if ($this->tokenFlag && $this->tokenUseFlag && $r === true){
            while ($this->tokenFlag){
                $this->log("Recursively fetching more items");
                $this->fetchItems(false);
            }
        }
    }
public function fetchItems ( $ r = true ) { $ this -> prepareToken ( ) ; $ url = $ this -> urlbase . $ this -> urlbranch ; $ query = $ this -> genQuery ( ) ; $ path = $ this -> options [ 'Action' ] . 'Result' ; if ( $ this -> mockMode ) { $ xml = $ this -> fetchMockFile ( ) -> $ path ; } else { $ response = $ this -> sendRequest ( $ url , array ( 'Post' => $ query ) ) ; if ( ! $ this -> checkResponse ( $ response ) ) { return false ; } $ xml = simplexml_load_string ( $ response [ 'body' ] ) -> $ path ; } if ( is_null ( $ xml -> AmazonOrderId ) ) { $ this -> log ( "You just got throttled." , 'Warning' ) ; return false ; } $ this -> orderId = ( string ) $ xml -> AmazonOrderId ; if ( ! empty ( $ this -> options [ 'AmazonOrderId' ] ) && $ this -> options [ 'AmazonOrderId' ] != $ this -> orderId ) { $ this -> log ( 'You grabbed the wrong Order\'s items! - ' . $ this -> options [ 'AmazonOrderId' ] . ' =/= ' . $ this -> orderId , 'Urgent' ) ; } $ this -> parseXML ( $ xml -> OrderItems ) ; $ this -> checkToken ( $ xml ) ; if ( $ this -> tokenFlag && $ this -> tokenUseFlag && $ r === true ) { while ( $ this -> tokenFlag ) { $ this -> log ( "Recursively fetching more items" ) ; $ this -> fetchItems ( false ) ; } } }
Retrieves the items from Amazon.

Submits a <i>ListOrderItems</i> request to Amazon. In order to do this,
an Amazon order ID is required. Amazon will send
the data back as a response, which can be retrieved using <i>getItems</i>.
Other methods are available for fetching specific values from the order.
This operation can potentially involve tokens.
@param boolean $r [optional] <p>When set to <b>FALSE</b>, the function will not recurse, defaults to <b>TRUE</b></p>
@return boolean <b>FALSE</b> if something goes wrong
Retrieves the items from Amazon .