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 */
22 function listGroupMembership($person, $arrayof = 'group_id')
24 $this->inAdmin = false;
26 //DB_DataObject::debugLevel(1);
29 $t->joinAdd(DB_DataObject::factory('Groups'), 'LEFT');
30 //$person->id = (int)$person->id;
32 user_id = {$person->id}
35 $t->selectAdd('distinct(group_id), Groups.name as name');
39 $ret = $arrayof == 'group_id' ? array(0) : array(); // default member of 'All groups'!!
42 $ret[] = $t->$arrayof;
43 if ($t->name == 'Administrators') { /// mmh... bit risky?
44 $this->inAdmin = true;
50 function checkPerm($lvl, $au)
54 function fetchAll($k= false) {
62 while ($this->fetch()) {
63 $ret[] = $k === false ? clone($this) : $this->$k;