diff options
-rw-r--r-- | app/class/object.class.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php index f9fde02..ee3dc21 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -50,6 +50,15 @@ class object extends table } /* + * Get the object type for the given GUID + */ + public static function typeOf(string $guid) : string + { + $obj = new object($guid); + return $obj->objtype; + } + + /* * Get the owner of this object. Either a user object or a group * object will be returned. If this object does not have an owner, * NULL will be returned. @@ -59,9 +68,7 @@ class object extends table if (!isset($this->owner) || $this->owner == "") return NULL; - $obj = new object($this->owner); - - if ($obj->objtype == "group") + if (self::typeOf($this->owner) == "group") return new group($this->owner); return new user($this->owner); |