diff options
author | Luis Ramón López <[email protected]> | 2014-01-02 22:40:13 +0100 |
---|---|---|
committer | Simon Holywell <[email protected]> | 2014-04-26 13:33:06 +0100 |
commit | cb955b5763f64a0c31c81371db698c1e78ee3d71 (patch) | |
tree | 920514fe38796256bd971d5b5af3063e6e96206d /idiorm.php | |
parent | d09ab6427f1ea7c3c46e91dabb4914b65b37bff0 (diff) |
delete() method is now compound primary keys aware
Diffstat (limited to 'idiorm.php')
-rw-r--r-- | idiorm.php | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -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); } /** |