public function nextItem()
    {
        if ($this->batch === null) {
            $this->batch = [];
        }
        
        //If no items in batch, and we have a resumptionToken or need to make initial request...
        if (count($this->batch) == 0 && ($this->resumptionToken or $this->numRequests == 0)) {
            $this->retrieveBatch();
        }

        //if still items in current batch, return one
        if (count($this->batch) > 0) {
            $this->numProcessed++;

            $item = array_shift($this->batch);
            $this->currItem = clone $item;
        } else {
            $this->currItem = false;
        }

        return $this->currItem;
    }
public function nextItem()
    {
        if ($this->batch === null) {
            $this->batch = [];
        }
        
        //If no items in batch, and we have a resumptionToken or need to make initial request...
        if (count($this->batch) == 0 && ($this->resumptionToken or $this->numRequests == 0)) {
            $this->retrieveBatch();
        }

        //if still items in current batch, return one
        if (count($this->batch) > 0) {
            $this->numProcessed++;

            $item = array_shift($this->batch);
            $this->currItem = clone $item;
        } else {
            $this->currItem = false;
        }

        return $this->currItem;
    }
public function nextItem ( ) { if ( $ this -> batch === null ) { $ this -> batch = [ ] ; } //If no items in batch, and we have a resumptionToken or need to make initial request... if ( count ( $ this -> batch ) == 0 && ( $ this -> resumptionToken or $ this -> numRequests == 0 ) ) { $ this -> retrieveBatch ( ) ; } //if still items in current batch, return one if ( count ( $ this -> batch ) > 0 ) { $ this -> numProcessed ++ ; $ item = array_shift ( $ this -> batch ) ; $ this -> currItem = clone $ item ; } else { $ this -> currItem = false ; } return $ this -> currItem ; }
Get the next item

Return an item from the currently-retrieved batch, get next batch and
return first record from it, or return false if no more records

@return \SimpleXMLElement|bool
Get the next item