protected function storeIteratorState()
    {
        if (! $this->startedIterating) {
            $this->current = null;
            $this->key = null;
            $this->valid = false;
            return null;
        }

        $this->current = $this->ensureIterator()->current();
        $this->key = $this->ensureIterator()->key();
        $this->valid = $this->ensureIterator()->valid();

        if ($this->current !== null) {
            $this->current = TypeConverter::toLegacy($this->current);
        }

        return $this->current;
    }
protected function storeIteratorState()
    {
        if (! $this->startedIterating) {
            $this->current = null;
            $this->key = null;
            $this->valid = false;
            return null;
        }

        $this->current = $this->ensureIterator()->current();
        $this->key = $this->ensureIterator()->key();
        $this->valid = $this->ensureIterator()->valid();

        if ($this->current !== null) {
            $this->current = TypeConverter::toLegacy($this->current);
        }

        return $this->current;
    }
protected function storeIteratorState ( ) { if ( ! $ this -> startedIterating ) { $ this -> current = null ; $ this -> key = null ; $ this -> valid = false ; return null ; } $ this -> current = $ this -> ensureIterator ( ) -> current ( ) ; $ this -> key = $ this -> ensureIterator ( ) -> key ( ) ; $ this -> valid = $ this -> ensureIterator ( ) -> valid ( ) ; if ( $ this -> current !== null ) { $ this -> current = TypeConverter :: toLegacy ( $ this -> current ) ; } return $ this -> current ; }
Stores the current cursor element.

This is necessary because hasNext() might advance the iterator but we still
need to be able to return the current object.
Stores the current cursor element .