summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2015-12-18 01:03:40 -0500
committerMalf Furious <m@lfurio.us>2015-12-18 01:03:40 -0500
commit6bc0491af4349a03a2d9f2040f36901aa5497d0d (patch)
treea20e37d54871290f6136aff3425a9e2af720f2e3 /app
parent2d674ddde9b02a5800e7b7004bc7453305e5862c (diff)
downloadscrott-6bc0491af4349a03a2d9f2040f36901aa5497d0d.tar.gz
scrott-6bc0491af4349a03a2d9f2040f36901aa5497d0d.zip
+ Added delObj function to object class
Diffstat (limited to 'app')
-rw-r--r--app/class/object.class.php17
1 files changed, 17 insertions, 0 deletions
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);
+ }
}
?>