From 19fac440ae8cf1a03e491825fb7d33313c451caa Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 4 Feb 2017 22:10:43 -0500 Subject: Add agent class --- app/class/agent.class.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/class/agent.class.php diff --git a/app/class/agent.class.php b/app/class/agent.class.php new file mode 100644 index 0000000..7c3b23c --- /dev/null +++ b/app/class/agent.class.php @@ -0,0 +1,54 @@ +getOwner()->guid == $this->guid; + } + + /* + * Check whether this agent is a member of the given object + */ + public function isMemberOf(object $obj) : bool + { + foreach ($obj->getMembers() as $memb) + { + if ($memb->guid == $this->guid) + return true; + } + + return false; + } +} + +?> -- cgit v1.2.3