function __construct($id = '', $parent = null) { $args = func_get_args(); $defaults = $this->integrate_id($id); if (!is_array($parent)) { $defaults['parent'] = $parent; } $props = $this->make_properties($args, $defaults); parent::__construct($props); }
/** * Retrieve item data * @param $item Item to get data for * @param $context (optional) Context * @param $top (optional) Iterate through ancestors to get data (Default: Yes) * @return mixed Item data */ function get_data($item = null, $context = '', $top = true) { $this->load_data(); $ret = null; if ($this->has($item)) { $item = $this->get($item); $ret = $item->get_data($context, $top); } else { $ret = parent::get_data($context, $top); } if (is_string($item) && is_array($ret) && isset($ret[$item])) { $ret = $ret[$item]; } return $ret; }