public function hasNext()
    {
        if (! $this->startedIterating) {
            $this->ensureIterator();
            $this->startedIterating = true;
            $this->storeIteratorState();
            $this->cursorNeedsAdvancing = false;
        } elseif ($this->cursorNeedsAdvancing) {
            $this->ensureIterator()->next();
            $this->cursorNeedsAdvancing = false;
        }

        return $this->ensureIterator()->valid();
    }
public function hasNext()
    {
        if (! $this->startedIterating) {
            $this->ensureIterator();
            $this->startedIterating = true;
            $this->storeIteratorState();
            $this->cursorNeedsAdvancing = false;
        } elseif ($this->cursorNeedsAdvancing) {
            $this->ensureIterator()->next();
            $this->cursorNeedsAdvancing = false;
        }

        return $this->ensureIterator()->valid();
    }
public function hasNext ( ) { if ( ! $ this -> startedIterating ) { $ this -> ensureIterator ( ) ; $ this -> startedIterating = true ; $ this -> storeIteratorState ( ) ; $ this -> cursorNeedsAdvancing = false ; } elseif ( $ this -> cursorNeedsAdvancing ) { $ this -> ensureIterator ( ) -> next ( ) ; $ this -> cursorNeedsAdvancing = false ; } return $ this -> ensureIterator ( ) -> valid ( ) ; }
Checks if there are any more elements in this cursor
@link http://www.php.net/manual/en/mongocursor.hasnext.php
@throws MongoConnectionException
@throws MongoCursorTimeoutException
@return bool Returns true if there is another element
Checks if there are any more elements in this cursor