public static function getPath($id, $excludeItself = false) { $rez = array('success' => false); if (!is_numeric($id)) { return $rez; } $r = DM\Tree::getBasicInfo($id); if (!empty($r)) { $p = explode(',', $r['pids']); if ($excludeItself) { array_pop($r['pids']); } $p = implode('/', $p); $rez = array('success' => true, 'id' => $id, 'name' => $r['name'], 'path' => $p); } return $rez; }
/** * get basic info for a given object id * @param int $id * @return json responce */ public static function getBasicInfoForId($id) { $rez = array('success' => false, 'id' => $id, 'data' => array()); if (empty($id) || !is_numeric($id)) { return $rez; } $rez['success'] = true; $rez['data'] = DM\Tree::getBasicInfo($id); return $rez; }
public function getData() { return DM\Tree::getBasicInfo($this->id); }