Пример #1
0
 /**
  * 添加新对象/记录
  * @access public
  * @param bool $allowPrimaryKey 是否允许插入主键值?默认为false
  * @return mixed
  */
 public function insert($allowPrimaryKey = FALSE)
 {
     if ($this->_db_table->toArray() === null) {
         return false;
     }
     $this->_allotDatabaseServer('INSERT');
     $data = $this->_db_table->toArray($allowPrimaryKey);
     $this->_db_table->__insertBefore($data);
     $result = $this->_db_drive_connect->insert($this->_db_table->getTableName(), $data);
     if ($result !== false) {
         $this->_db_table->__insert($result, $data);
     }
     return $result;
 }