DataObjects/Groups.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 12 Jan 2012 02:28:57 +0000 (10:28 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 12 Jan 2012 02:28:57 +0000 (10:28 +0800)
DataObjects/Groups.php

index 3366754..88f63c5 100755 (executable)
@@ -78,6 +78,16 @@ class Pman_Core_DataObjects_Groups extends DB_DataObject
         
     }
     
+    
+    function addMember($person) {
+        $gm = DB_Dataobject::factory('Group_Members');
+        $gm->group_id = $this->id;
+        $gm->user_id = $person->id;
+        if (!$gm->count()) {
+            $gm->insert();
+        }
+    }
+    
     function members()
     {