Exemplo n.º 1
0
 /**
  * 删除符合条件的记录
  *
  * @param mixed $where
  */
 function delete($where)
 {
     if (!$this->_inited) {
         $this->init();
     }
     if (is_int($where) || (int) $where == $where && $where > 0) {
         // 如果 $where 是一个整数,则假定为主键字段值
         if ($this->_is_cpk) {
             // LC_MSG: 使用复合主键时,不允许通过直接指定主键值来删除记录.
             throw new QDB_Table_Exception(__('使用复合主键时,不允许通过直接指定主键值来删除记录.'));
         } else {
             $where = array(array($this->_pk[0] => (int) $where));
         }
     } else {
         $where = func_get_args();
     }
     $this->_conn->delete($this->getFullTableName(), $where);
 }