summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--idiorm.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/idiorm.php b/idiorm.php
index d0e98c8..3ea98a7 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -1929,15 +1929,12 @@
* Delete this record from the database
*/
public function delete() {
- $query = join(" ", array(
+ $query = array(
"DELETE FROM",
- $this->_quote_identifier($this->_table_name),
- "WHERE",
- $this->_quote_identifier($this->_get_id_column_name()),
- "= ?",
- ));
-
- return self::_execute($query, array($this->id()), $this->_connection_name);
+ $this->_quote_identifier($this->_table_name)
+ );
+ $this->_add_id_column_conditions($query);
+ return self::_execute(join(" ", $query), is_array($this->id()) ? array_values($this->id()) : array($this->id()), $this->_connection_name);
}
/**