當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DboSource::lastAffected方法代碼示例

本文整理匯總了PHP中DboSource::lastAffected方法的典型用法代碼示例。如果您正苦於以下問題:PHP DboSource::lastAffected方法的具體用法?PHP DboSource::lastAffected怎麽用?PHP DboSource::lastAffected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DboSource的用法示例。


在下文中一共展示了DboSource::lastAffected方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLastAffected

 /**
  * testLastAffected method
  *
  *
  * @return void
  */
 public function testLastAffected()
 {
     $this->Dbo->cacheSources = false;
     $tableName = 'tinyint_' . uniqid();
     $this->Dbo->rawQuery('CREATE TABLE ' . $this->Dbo->fullTableName($tableName) . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
     $this->model = new CakeTestModel(array('name' => 'Tinyint', 'table' => $tableName, 'ds' => 'test'));
     $this->assertTrue((bool) $this->model->save(array('bool' => 5, 'small_int' => 5)));
     $this->assertEquals(1, $this->model->find('count'));
     $this->model->deleteAll(true);
     $result = $this->Dbo->lastAffected();
     $this->assertEquals(1, $result);
     $this->assertEquals(0, $this->model->find('count'));
     $this->Dbo->rawQuery('DROP TABLE ' . $this->Dbo->fullTableName($tableName));
 }
開發者ID:laiello,項目名稱:double-l-bookmanagement,代碼行數:20,代碼來源:MysqlTest.php

示例2: lastAffected

 /**
  * Returns number of affected rows in previous database operation. If no previous operation exists,
  * this returns false.
  *
  * @param mixed $source
  * @return integer Number of affected rows
  */
 public function lastAffected($source = null)
 {
     $affected = parent::lastAffected();
     if ($affected === null && $this->_lastAffected !== false) {
         return $this->_lastAffected;
     }
     return $affected;
 }
開發者ID:alphp,項目名稱:cakephp-2.x_oracle-driver,代碼行數:15,代碼來源:Oracle.php

示例3: lastAffected

 /**
  * Returns number of affected rows in previous database operation. If no previous operation exists,
  * this returns false.
  *
  * @param mixed $source Unused
  *
  * @return int Number of affected rows
  */
 public function lastAffected($source = NULL)
 {
     $affected = parent::lastAffected();
     if ($affected === NULL && $this->_lastAffected !== FALSE) {
         return $this->_lastAffected;
     }
     return $affected;
 }
開發者ID:mrbadao,項目名稱:api-official,代碼行數:16,代碼來源:Sqlserver.php


注:本文中的DboSource::lastAffected方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。