Example #1
0
 public function addAll($dataList, $options = array(), $replace = false)
 {
     if (empty($dataList)) {
         $this->error = L('_DATA_TYPE_INVALID_');
         return false;
     }
     // 数据处理
     foreach ($dataList as $key => $data) {
         $dataList[$key] = $this->_facade($data);
     }
     // 分析表达式
     $options = $this->_parseOptions($options);
     // 写入数据到数据库
     $result = $this->db->insertAll($dataList, $options, $replace);
     if (false !== $result) {
         $insertId = $this->getLastInsID();
         if ($insertId) {
             return $insertId;
         }
     }
     return $result;
 }