public static function delete(array $where)
{
if (!sizeof($where)) {
throw new DbException("Method `Table::delete()` can't delete all records in table,\n" . "please use `Db::query()` instead (of cause if you know what are you doing)");
}
$self = static::getInstance();
$where = $self->filterColumns($where);
if (!sizeof($where)) {
throw new DbException("Invalid field names of table `{$self->table}`. Please check use of `delete()` method");
}
$table = DbProxy::quoteIdentifier($self->table);
$sql = "DELETE FROM {$table}" . " WHERE " . join(' AND ', self::prepareStatement($where));
return DbProxy::query($sql, array_values($where));
}