/** * read current id index from database * * @return void */ protected function read_data() { $db = Core::get_database($this->driver, $this->database); $condition = '`id`=' . intval($this->id); $items = $db->get($this->table, $condition); if (empty($items)) { $data = array(); for ($i = 0; $i < $this->columns; $i++) { $data[] = array(); } } else { $data = $this->unpack($items[0]['data']); } $this->index_data = $data; }
public function __construct() { $this->db_handle = Core::get_database($this->driver, $this->database); }