summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorLuis Ramón López <[email protected]>2014-01-02 22:40:13 +0100
committerSimon Holywell <[email protected]>2014-04-26 13:33:06 +0100
commitcb955b5763f64a0c31c81371db698c1e78ee3d71 (patch)
tree920514fe38796256bd971d5b5af3063e6e96206d /idiorm.php
parentd09ab6427f1ea7c3c46e91dabb4914b65b37bff0 (diff)
delete() method is now compound primary keys aware
Diffstat (limited to 'idiorm.php')
-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);
}
/**