示例#1
0
 /**
  * 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;
 }
示例#2
0
 public function __construct()
 {
     $this->db_handle = Core::get_database($this->driver, $this->database);
 }