summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-03-01 19:50:17 -0500
committerMalf Furious <m@lfurio.us>2016-03-01 19:50:17 -0500
commit6252381a2f8c1de374a2ad35d20bc10393d6f47a (patch)
treebe1a8f0cbf4e0fea99a0b80b73abd8f2f7851b80 /app
parentd54cf990c7fe8b2f5de7b572fac493bc9936e06a (diff)
downloadscrott-6252381a2f8c1de374a2ad35d20bc10393d6f47a.tar.gz
scrott-6252381a2f8c1de374a2ad35d20bc10393d6f47a.zip
Add garbage collection logic to Object::delObj()
Now, on deletion of objects, all refs to it are purged from the xref tables, obj_member and msg_read
Diffstat (limited to 'app')
-rw-r--r--app/class/object.class.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php
index 96cc810..bc8a67f 100644
--- a/app/class/object.class.php
+++ b/app/class/object.class.php
@@ -181,6 +181,14 @@ abstract class Object extends Framework
/* Delete Child */
$query = "DELETE FROM `" . $this->childTable . "` WHERE `guid` = '" . $this->db->esc($this->guid) . "'";
$this->db->query($query);
+
+ /* obj_member garbage collection */
+ $query = "DELETE FROM `obj_member` WHERE `guid` = '" . $this->db->esc($this->guid) . "' OR `member` = '" . $this->db->esc($this->guid) . "'";
+ $this->db->query($query);
+
+ /* msg_read garbage collection */
+ $query = "DELETE FROM `msg_read` WHERE `guid` = '" . $this->db->esc($this->guid) . "' OR `user` = '" . $this->db->esc($this->guid) . "'";
+ $this->db->query($query);
}
/*