From 6bc0491af4349a03a2d9f2040f36901aa5497d0d Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 18 Dec 2015 01:03:40 -0500 Subject: + Added delObj function to object class --- app/class/object.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app') diff --git a/app/class/object.class.php b/app/class/object.class.php index fb38ef7..7f73382 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -158,6 +158,23 @@ abstract class Object extends Framework } } } + + /* + * Remove this object from the database + */ + function delObj() + { + if (!isset($this->guid)) + return; + + /* Delete Base */ + $query = "DELETE FROM `" . $this->table . "` WHERE `guid` = '" . $this->db->esc($this->guid) . "'"; + $this->db->query($query); + + /* Delete Child */ + $query = "DELETE FROM `" . $this->childTable . "` WHERE `guid` = '" . $this->db->esc($this->guid) . "'"; + $this->db->query($query); + } } ?> -- cgit v1.2.3