diff options
-rw-r--r-- | app/class/object.class.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/class/object.class.php b/app/class/object.class.php index 42c9355..a64bdfb 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -252,6 +252,22 @@ abstract class Object extends Framework { return hash("sha256", openssl_random_pseudo_bytes(64)); } + + /* + * Get an array of all members of this object + */ + function getMembers() + { + $query = "SELECT member FROM obj_member WHERE guid = '" . $this->db->esc($this->guid) . "'"; + $result = $this->db->query($query); + + $members = array(); + + foreach ($result as $m) + $members[] = new User($m['member']); + + return $members; + } } /* |