/** * @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(); }
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()); }
/** * @param string $key */ public function delete($key) { $query = new CM_Db_Query_Delete($this->_getDatabaseClient(), 'cm_option', array('key' => $key)); $query->execute(); $this->_clearCache(); }