diff options
author | Malf Furious <m@lfurio.us> | 2017-03-26 19:00:03 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-03-26 19:00:03 -0400 |
commit | 356a3b04848b04eb2bb8be3c3fd457c492f9cb3f (patch) | |
tree | 13e6ca30e1a2e563e5347fb0c90044bcba46c766 /app/class/object.class.php | |
parent | 1ff545e5621ba711cd20aec06f4f39d645c2600a (diff) | |
download | scrott-356a3b04848b04eb2bb8be3c3fd457c492f9cb3f.tar.gz scrott-356a3b04848b04eb2bb8be3c3fd457c492f9cb3f.zip |
Add functions for object hierarchy mgmt
Added to object class, functions: setOwner, getParent, setParent.
Diffstat (limited to 'app/class/object.class.php')
-rw-r--r-- | app/class/object.class.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php index ee3dc21..1fbe923 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -75,6 +75,34 @@ class object extends table } /* + * Update the owner of this object + */ + public function setOwner(agent $owner) : void + { + $this->owner = $owner->guid; + } + + /* + * Get the parent of this object. If this object does not have a + * parent, NULL will be returned. + */ + public function getParent() : ?object + { + if (!isset($this->parent) || $this->parent == "") + return NULL; + + return new object($this->parent); + } + + /* + * Update the parent of this object + */ + public function setParent(object $parent) : void + { + $this->parent = $parent->guid; + } + + /* * Get an array of all members of this object */ public function getMembers() : array |