/** * 获取表中所有数据 * @return \ORC\DAO\Table\DataList */ public function getAll() { if (!isset($this->data)) { $this->data = Util::getTableData($this->table_name); } return $this->data; }
/** * @return \ORC\DAO\Table\DataList */ public function getAll() { static $points; if ($points == null) { $points = Util::getTableData('knowledge_points'); } return $points; }
public static function getAllRoles() { static $roles; if (!isset($roles)) { $list = Util::getTableData('admin_roles'); $roles = $list->toArray('id', 'name'); } return $roles; }
public static function createFromDB($table, $nodeClass, $useCache = true) { if ($table instanceof Table) { $table_name = $table->getTableName(); } $list = \ORC\DAO\Util::getTableData($table, $useCache); $tree = new UnSortedTree(new $nodeClass()); foreach ($list as $row) { $tree->addByKey(new $nodeClass($row), $row->get('parent_id')); } return $tree; }