From: Stéphane Jacob Date: Fri, 13 May 2011 12:00:53 +0000 (+0200) Subject: Properly deletes address components on address deletion; return number of affected... X-Git-Tag: xorg/1.1.2~62^2~22 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=02228cb2df1e;p=platal.git Properly deletes address components on address deletion; return number of affected rows. Signed-off-by: Stéphane Jacob --- 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)