예제 #1
0
 public function rows()
 {
     $table = new Hi_Db_Table('user_resource');
     //取道表的过滤工具对象,并过滤出resourceID > 1的记录
     $cond = $table->getCondition();
     $cond->add('resourceID', 1, '>');
     $row = $table->rows();
     print_r($row);
 }
예제 #2
0
 /**
  * 删除id指向的记录
  * @param $id
  * @return unknown_type
  */
 public function delete($id = null)
 {
     $this->setId($id);
     if ($this->_id === null) {
         throw new Hi_Db_Table_Exception("需要被删除行的id");
     }
     $cond = $this->_table->getCondition();
     $cond->add($this->_primaryKey, $this->_id);
     $this->_table->delete();
 }