/** * @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; }
public function __construct($table_name) { list($server_name, $table_name) = Util::parseTableName($table_name); $this->_table_name = $table_name; $this->_server_name = $server_name; $table_name = sprintf('%s.%s', $server_name, $table_name); $schema = Schema::getInstance()->getTableSchema($table_name); $this->_pk = implode(',', $schema->get('indexes.primary')); $this->_schema = $schema; if (!$this->_pk) { //$this->_pk = 'id'; } }
protected function parseTableName($table_name) { return Util::parseTableName($table_name); }
protected function flushCache() { Util::flushTableDataCache($this->table_name); unset($this->data); return true; }