callToString = (bool)($cit_flags & CachingIterator::CALL_TOSTRING); } /** @return the current element prefixed with ASCII graphics */ function current() { $tree = ''; for ($l=0; $l < $this->getDepth(); $l++) { $tree .= $this->getSubIterator($l)->hasNext() ? '| ' : ' '; } return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-') . ($this->callToString ? $this->getSubIterator($l)->__toString() : $this->getSubIterator($l)->current()); } /** Aggregates the inner iterator */ function __call($func, $params) { return call_user_func_array(array($this->getSubIterator(), $func), $params); } }