Exemplo n.º 1
0
 /**
  * 为当前数据表的指定字段产生一个序列值
  *
  * @param $field_name
  *
  * @return mixed
  */
 function nextID($field_name = null)
 {
     if (!$this->_inited) {
         $this->init();
     }
     if (is_null($field_name)) {
         $field_name = $this->_pk[0];
     }
     return $this->_conn->nextID($this->getFullTableName(), $field_name);
 }
Exemplo n.º 2
0
 function testInsertID2()
 {
     $id = $this->dbo->nextID('testseq', 'id');
     $insertID = $this->dbo->insertID();
     $this->assertEquals($id, $insertID, '$id == $insertID');
 }