_unfolder = $unfolder; parent::__construct($items); $this->_innerIterator = $this->getInnerIterator(); } /** * Returns true as each of the elements in the array represent a * list of items * * @return bool */ public function hasChildren() { return true; } /** * Returns an iterator containing the items generated by transforming * the current value with the callable function. * * @return \RecursiveIterator */ public function getChildren() { $current = $this->current(); $key = $this->key(); $unfolder = $this->_unfolder; return new NoChildrenIterator($unfolder($current, $key, $this->_innerIterator)); } }