コード例 #1
0
 /**
  * 获取表中所有数据
  * @return \ORC\DAO\Table\DataList
  */
 public function getAll()
 {
     if (!isset($this->data)) {
         $this->data = Util::getTableData($this->table_name);
     }
     return $this->data;
 }
コード例 #2
0
 /**
  * @return \ORC\DAO\Table\DataList
  */
 public function getAll()
 {
     static $points;
     if ($points == null) {
         $points = Util::getTableData('knowledge_points');
     }
     return $points;
 }
コード例 #3
0
 public static function getAllRoles()
 {
     static $roles;
     if (!isset($roles)) {
         $list = Util::getTableData('admin_roles');
         $roles = $list->toArray('id', 'name');
     }
     return $roles;
 }
コード例 #4
0
 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;
 }