diff options
Diffstat (limited to 'app/class/object.class.php')
-rw-r--r-- | app/class/object.class.php | 17 |
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); + } } ?> |