コード例 #1
0
ファイル: Db.php プロジェクト: NicolasSchmutz/cm
 /**
  * @param string            $table
  * @param string|array|null $where
  * @return int
  */
 public static function delete($table, $where = null)
 {
     $client = self::getClient();
     $query = new CM_Db_Query_Delete($client, $table, $where);
     return $query->execute()->getAffectedRows();
 }
コード例 #2
0
ファイル: DeleteTest.php プロジェクト: cargomedia/cm
 public function testDelete()
 {
     $query = new CM_Db_Query_Delete(self::$_client, 't`est', array('foo' => 'foo1'));
     $this->assertSame('DELETE FROM `t``est` WHERE `foo` = ?', $query->getSqlTemplate());
 }
コード例 #3
0
ファイル: Options.php プロジェクト: cargomedia/cm
 /**
  * @param string $key
  */
 public function delete($key)
 {
     $query = new CM_Db_Query_Delete($this->_getDatabaseClient(), 'cm_option', array('key' => $key));
     $query->execute();
     $this->_clearCache();
 }