diff options
Diffstat (limited to '')
| -rw-r--r-- | app/class/agent.class.php | 17 | 
1 files changed, 17 insertions, 0 deletions
| diff --git a/app/class/agent.class.php b/app/class/agent.class.php index 4af13d5..63a21ed 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -33,6 +33,23 @@ abstract class agent extends obj      }      /* +     * Since this class is abstract, this function is provided as a +     * means of constructing the appropriate agent object based on +     * a GUID. +     */ +    public static function getAgentObj(string $guid) : agent +    { +        try +        { +            return new user($guid); +        } +        catch (Exception $e) +        { +            return new group($guid); +        } +    } + +    /*       * Check whether this agent is the owner of the given object       */      public function isOwnerOf(obj $obj) : bool | 
