public function delete($table, $conditions, $bind = [])
{
if (is_string($conditions)) {
$conditions = [$conditions];
}
$wheres = [];
/** @noinspection ForeachSourceInspection */
foreach ($conditions as $k => $v) {
if (is_int($k)) {
$wheres[] = Text::contains($v, ' or ', true) ? "({$v})" : $v;
} else {
$wheres[] = "`{$k}`=:{$k}";
$bind[$k] = $v;
}
}
$sql = "DELETE FROM `{$table}` WHERE " . implode(' AND ', $wheres);
return $this->execute($sql, $bind);
}