public function rewind()
{
$this->_started = true;
reset($this->_data);
$this->_valid = !empty($this->_data) || $this->_populate() !== null;
return current($this->_data);
}
/** * Rewinds the collection of sub-`Document`s to the beginning and returns the first one found. * * @return object Returns the first `Document` object instance in the collection. */ public function rewind() { $data = parent::rewind(); $key = key($this->_data); return $this->offsetGet($key); }