/** * Return values in a tree structure * @return array */ public function getValues() { $rows = parent::getValues(); $rowReferences = array(); $ret = array(); $pk = $this->parser->getPK(); $fk = $this->parser->getFK(); $childKey = $this->parser->getChildKey(); foreach ($rows as &$row) { $rowReferences[$row[$pk]] =& $row; if (isset($row[$fk])) { $parent =& $rowReferences[$row[$fk]]; if (!isset($parent[$childKey])) { $parent[$childKey] = array(); } $parent[$childKey][] =& $row; } else { $ret[] =& $row; } unset($row[$fk]); } return $ret; }
public function getValues() { return parent::getValues(); }