Compare commits

..

No commits in common. "master" and "3.5.9" have entirely different histories.

View file

@ -35,7 +35,7 @@
*/ */
private function throw_if_no_table() { private function throw_if_no_table() {
if (!isset($this->table)) { if (!$this->table) {
throw new Exception("No table name defined"); throw new Exception("No table name defined");
} }
} }
@ -268,14 +268,9 @@
$this->throw_if_no_table(); $this->throw_if_no_table();
// Set DELETE WHERE conditions from arguments // Set DELETE WHERE conditions from arguments
if ($conditions) { $this->where(...$conditions);
$this->where(...$conditions);
}
// Get array of SQL WHERE string and filter values $sql = "DELETE FROM `{$this->table}` WHERE {$this->filter_sql}";
$filter_sql = !is_null($this->filter_sql) ? " WHERE {$this->filter_sql}" : "";
$sql = "DELETE FROM `{$this->table}`{$filter_sql}";
return $this->execute_query($sql, self::to_list_array($this->filter_values)); return $this->execute_query($sql, self::to_list_array($this->filter_values));
} }