3 * Table Definition for Group_Members
5 require_once 'DB/DataObject.php';
7 class Pman_Core_DataObjects_Group_Members extends DB_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'Group_Members'; // table name
13 public $group_id; // int(11)
14 public $id; // int(11) not_null primary_key auto_increment
15 public $user_id; // int(11) not_null
18 /* the code above is auto generated do not remove the tag below */
24 * Get a list of memberships for a person
25 * @param Pman_Core_DataObjects_Person $person who
26 * @param String column to fetch.. eg. group_id or 'name'
30 function listGroupMembership($person, $arrayof = 'group_id')
32 $this->inAdmin = false;
34 //DB_DataObject::debugLevel(1);
37 $t->joinAdd(DB_DataObject::factory('Groups'), 'LEFT');
38 //$person->id = (int)$person->id;
40 user_id = {$person->id}
43 $t->selectAdd('distinct(group_id), Groups.name as name');
47 $ret = $arrayof == 'group_id' ? array(0) : array();
48 // default member of 'All groups'!!
51 $ret[] = $t->$arrayof;
52 if ($t->name == 'Administrators') { /// mmh... bit risky?
53 $this->inAdmin = true;
59 function checkPerm($lvl, $au)