ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSessionParticipants.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24include_once('./Services/Membership/classes/class.ilParticipants.php');
25include_once './Modules/Session/classes/class.ilEventParticipants.php';
26
38{
39 const COMPONENT_NAME = 'Modules/Session';
40
41 protected static $instances = array();
42
43 protected $event_part = null;
44
51 public function __construct($a_obj_id)
52 {
53 $this->type = 'sess';
54 $this->event_part = new ilEventParticipants($a_obj_id);
55 parent::__construct(self::COMPONENT_NAME,$a_obj_id);
56
57 }
58
68 public static function _getInstanceByObjId($a_obj_id)
69 {
70 if(isset(self::$instances[$a_obj_id]) and self::$instances[$a_obj_id])
71 {
72 return self::$instances[$a_obj_id];
73 }
74 return self::$instances[$a_obj_id] = new ilSessionParticipants($a_obj_id);
75 }
76
81 public function getEventParticipants()
82 {
83 return $this->event_part;
84 }
85
94 public static function _isParticipant($a_ref_id,$a_usr_id)
95 {
98 }
99
103 public function readParticipants()
104 {
105 $this->participants = $this->members = $this->getEventParticipants()->getRegistered();
106 }
107
111 public function readParticipantsStatus()
112 {
113 $this->participants_status = array();
114 foreach($this->getMembers() as $mem_uid)
115 {
116 $this->participants_status[$mem_uid]['blocked'] = FALSE;
117 $this->participants_status[$mem_uid]['notification'] = FALSE;
118 $this->participants_status[$mem_uid]['passed'] = FALSE;
119 }
120 }
121
126 public function add($a_usr_id)
127 {
128 $this->getEventParticipants()->register($a_usr_id);
129 }
130
135 public function delete($a_usr_id)
136 {
137 $this->getEventParticipants()->unregister($a_usr_id);
138 }
139}
140?>
static _isRegistered($a_usr_id, $a_event_id)
static _lookupObjId($a_id)
getMembers()
Get all members ids (admins and tutors are not members) Use get participants to fetch all.
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
__construct($a_obj_id)
Constructor.
readParticipantsStatus()
read participant status