public function valid()
    {
        if ($this->_position <= $this->_length - 1) {
            // we have more results than the current position is
            return true;
        }

        if (!$this->_hasMore || !$this->_id) {
            // we don't have more results, but the cursor is exhausted
            return false;
        }

        // need to fetch additional results from the server
        $this->fetchOutstanding();

        return ($this->_position <= $this->_length - 1);
    }
public function valid()
    {
        if ($this->_position <= $this->_length - 1) {
            // we have more results than the current position is
            return true;
        }

        if (!$this->_hasMore || !$this->_id) {
            // we don't have more results, but the cursor is exhausted
            return false;
        }

        // need to fetch additional results from the server
        $this->fetchOutstanding();

        return ($this->_position <= $this->_length - 1);
    }
public function valid ( ) { if ( $ this -> _position <= $ this -> _length - 1 ) { // we have more results than the current position is return true ; } if ( ! $ this -> _hasMore || ! $ this -> _id ) { // we don't have more results, but the cursor is exhausted return false ; } // need to fetch additional results from the server $ this -> fetchOutstanding ( ) ; return ( $ this -> _position <= $ this -> _length - 1 ) ; }
Check if cursor can be advanced further, necessary for Iterator

This might issue additional HTTP requests to fetch any outstanding
results from the server

@throws Exception
@return bool - true if the cursor can be advanced further, false if cursor is at end
Check if cursor can be advanced further necessary for Iterator