From 02228cb2df1e93c70826742c0c81d7ace2f385fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 13 May 2011 14:00:53 +0200 Subject: [PATCH] Properly deletes address components on address deletion; return number of affected rows. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/address.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/address.php b/classes/address.php index 7bea442..bca9e5f 100644 --- a/classes/address.php +++ b/classes/address.php @@ -749,9 +749,14 @@ class Address public function delete() { + XDB::execute('DELETE FROM profile_addresses_components + WHERE pid = {?} AND jobid = {?} AND groupid = {?} AND type = {?} AND id = {?}', + $this->pid, $this->jobid, $this->groupid, $this->type, $this->id); XDB::execute('DELETE FROM profile_addresses WHERE pid = {?} AND jobid = {?} AND groupid = {?} AND type = {?} AND id = {?}', $this->pid, $this->jobid, $this->groupid, $this->type, $this->id); + + return XDB::affectedRows(); } static public function deleteAddresses($pid, $type, $jobid = null, $groupid = null, $deletePrivate = true) -- 2.1.4