3 * Table Definition for request_queue
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
7 class Group_join_queue extends Managed_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'group_join_queue'; // table name
18 function staticGet($k,$v=null)
19 { return Memcached_DataObject::staticGet('Group_join_queue',$k,$v); }
21 /* the code above is auto generated do not remove the tag below */
24 public static function schemaDef()
27 'description' => 'Holder for group join requests awaiting moderation.',
29 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'remote or local profile making the request'),
30 'group_id' => array('type' => 'int', 'description' => 'remote or local group to join, if any'),
31 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
33 'primary key' => array('profile_id', 'group_id'),
35 'group_join_queue_profile_id_created_idx' => array('profile_id', 'created'),
36 'group_join_queue_group_id_created_idx' => array('group_id', 'created'),
38 'foreign keys' => array(
39 'group_join_queue_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
40 'group_join_queue_group_id_fkey' => array('user_group', array('group_id' => 'id')),
45 public static function saveNew(Profile $profile, User_group $group)
47 $rq = new Group_join_queue();
48 $rq->profile_id = $profile->id;
49 $rq->group_id = $group->id;
50 $rq->created = common_sql_now();