Alcaeus\MongoDbAdapter\AbstractCursor::next PHP Method

next() public method

Advances the cursor to the next result, and returns that result
public next ( ) : array
return array Returns the next object
    public function next()
    {
        if (!$this->startedIterating) {
            $this->ensureIterator();
            $this->startedIterating = true;
        } else {
            if ($this->cursorNeedsAdvancing) {
                $this->ensureIterator()->next();
            }
            $this->cursorNeedsAdvancing = true;
            $this->position++;
        }
        return $this->storeIteratorState();
    }