ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilEventParticipants Class Reference

class ilEventParticipants More...

+ Collaboration diagram for ilEventParticipants:

Public Member Functions

 __construct (int $a_event_id)
 
 setUserId (int $a_usr_id)
 
 getUserId ()
 
 setMark (string $a_mark)
 
 getMark ()
 
 setComment (string $a_comment)
 
 getComment ()
 
 setParticipated (bool $a_status)
 
 getParticipated ()
 
 setRegistered (bool $a_status)
 
 getRegistered ()
 
 setExcused (bool $a_stat)
 
 getExcused ()
 
 getEventId ()
 
 setEventId (int $a_event_id)
 
 setContact (bool $a_status)
 
 getContact ()
 
 isNotificationEnabled ()
 
 setNotificationEnabled (bool $value)
 
 setParticipatedParticipants (array $participants_participated)
 
 getParticipatedParticipants ()
 
 setRegisteredParticipants (array $registered_participants)
 
 getRegisteredParticipants ()
 
 updateExcusedForUser (int $a_usr_id, bool $a_status)
 
 updateUser ()
 
 getUser (int $a_usr_id)
 
 getParticipants ()
 
 isRegistered (int $a_usr_id)
 
 hasParticipated (int $a_usr_id)
 
 isExcused (int $a_usr_id)
 
 isContact (int $a_usr_id)
 
 updateParticipation (int $a_usr_id, bool $a_status)
 
 register (int $a_usr_id)
 
 unregister (int $a_usr_id)
 
 _lookupComment (int $a_event_id, int $a_usr_id)
 

Static Public Member Functions

static _updateParticipation (int $a_usr_id, int $a_event_id, bool $a_status)
 
static _getRegistered (int $a_event_id)
 
static _getParticipated (int $a_event_id)
 
static _hasParticipated (int $a_usr_id, int $a_event_id)
 
static _isRegistered (int $a_usr_id, int $a_event_id)
 
static _register (int $a_usr_id, int $a_event_id)
 
static _unregister (int $a_usr_id, int $a_event_id)
 
static _lookupMark (int $a_event_id, int $a_usr_id)
 
static _deleteByEvent (int $a_event_id)
 
static _deleteByUser (int $a_usr_id)
 

Protected Member Functions

 __read ()
 

Protected Attributes

ilDBInterface $db
 
ilTree $tree
 
int $contact = 0
 
bool $registered = false
 
bool $participated = false
 
bool $excused = false
 
int $event_id = 0
 
bool $notificationEnabled = false
 
int $user_id = 0
 
string $mark = ""
 
string $comment = ""
 
array $participants = []
 
array $participants_registered = []
 
array $participants_participated = []
 

Detailed Description

class ilEventParticipants

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilEventParticipants.php 15697 2008-01-08 20:04:33Z hschottm

Definition at line 28 of file class.ilEventParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilEventParticipants::__construct ( int  $a_event_id)

Definition at line 45 of file class.ilEventParticipants.php.

46 {
47 global $DIC;
48
49 $this->db = $DIC->database();
50 $this->tree = $DIC->repositoryTree();
51 $this->event_id = $a_event_id;
52 $this->__read();
53 }
global $DIC
Definition: shib_login.php:26

References $DIC, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilEventParticipants::__read ( )
protected

Definition at line 462 of file class.ilEventParticipants.php.

462 : void
463 {
464 global $DIC;
465
468
469 $query = "SELECT * FROM event_participants " .
470 "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " ";
471 $res = $this->db->query($query);
472
473 $parentRecipients = [];
474 $parentParticipants = [];
475 $session = ilObjectFactory::getInstanceByObjId($this->event_id);
476 $refIdArray = array_values(ilObject::_getAllReferences($this->event_id));
477 if (true === $session->isRegistrationNotificationEnabled()) {
478 if (ilSessionConstants::NOTIFICATION_INHERIT_OPTION === $session->getRegistrationNotificationOption()) {
479 $parentRefId = $tree->checkForParentType($refIdArray[0], 'grp');
480 if (!$parentRefId) {
481 $parentRefId = $tree->checkForParentType($refIdArray[0], 'crs');
482 }
483 if ($parentRefId) {
485 $parentRecipients = $participants->getNotificationRecipients();
486 $parentParticipants = $participants->getParticipants();
487 }
488 }
489 }
490 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
491 $this->participants[(int) $row->usr_id]['usr_id'] = (int) $row->usr_id;
492 $this->participants[(int) $row->usr_id]['registered'] = (bool) $row->registered;
493 $this->participants[(int) $row->usr_id]['participated'] = (bool) $row->participated;
494 $this->participants[(int) $row->usr_id]['excused'] = (bool) $row->excused;
495 $this->participants[(int) $row->usr_id]['contact'] = (bool) $row->contact;
496
497 $lp_mark = new ilLPMarks($this->getEventId(), (int) $row->usr_id);
498 $this->participants[(int) $row->usr_id]['mark'] = $lp_mark->getMark();
499 $this->participants[(int) $row->usr_id]['comment'] = $lp_mark->getComment();
500
501 if (
502 $session->isRegistrationNotificationEnabled() &&
503 $session->getRegistrationNotificationOption() === ilSessionConstants::NOTIFICATION_MANUAL_OPTION
504 ) {
505 $this->participants[(int) $row->usr_id]['notification_enabled'] = (bool) $row->notification_enabled;
506 } elseif (in_array((int) $row->usr_id, $parentRecipients)) {
507 $this->participants[(int) $row->usr_id]['notification_enabled'] = true;
508 } else {
509 $this->participants[(int) $row->usr_id]['notification_enabled'] = false;
510 }
511 if ($row->registered) {
512 $this->participants_registered[] = (int) $row->usr_id;
513 }
514 if ($row->participated) {
515 $this->participants_participated[] = (int) $row->usr_id;
516 }
517 }
518 // add defaults for parent participants
519 foreach ($parentParticipants as $usr_id) {
520 if (isset($this->participants[$usr_id])) {
521 continue;
522 }
523 $this->participants[$usr_id]['usr_id'] = (int) $usr_id;
524 $this->participants[$usr_id]['registered'] = false;
525 $this->participants[$usr_id]['participated'] = false;
526 $this->participants[$usr_id]['excused'] = false;
527 $this->participants[$usr_id]['contact'] = false;
528 $lp_mark = new ilLPMarks($this->getEventId(), $usr_id);
529 $this->participants[$usr_id]['mark'] = $lp_mark->getMark();
530 $this->participants[$usr_id]['comment'] = $lp_mark->getComment();
531 $this->participants[$usr_id]['notification_enabled'] = false;
532 if (in_array($usr_id, $parentRecipients)) {
533 $this->participants[$usr_id]['notification_enabled'] = true;
534 }
535 }
536 }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstance(int $a_ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
$res
Definition: ltiservices.php:69

References $db, $DIC, $ilDB, $participants, $res, $tree, ilObject\_getAllReferences(), ilTree\checkForParentType(), ilDBConstants\FETCHMODE_OBJECT, getEventId(), ilParticipants\getInstance(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\int(), ilSessionConstants\NOTIFICATION_INHERIT_OPTION, and ilSessionConstants\NOTIFICATION_MANUAL_OPTION.

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByEvent()

static ilEventParticipants::_deleteByEvent ( int  $a_event_id)
static

Definition at line 434 of file class.ilEventParticipants.php.

434 : bool
435 {
436 global $DIC;
437
438 $ilDB = $DIC->database();
439
440 $query = "DELETE FROM event_participants " .
441 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " ";
442 $res = $ilDB->manipulate($query);
443
444 ilLPMarks::deleteObject($a_event_id);
445
446 return true;
447 }
static deleteObject(int $a_obj_id)

References $DIC, $ilDB, $res, and ilLPMarks\deleteObject().

Referenced by ilObjSession\delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteByUser()

static ilEventParticipants::_deleteByUser ( int  $a_usr_id)
static

Definition at line 449 of file class.ilEventParticipants.php.

449 : bool
450 {
451 global $DIC;
452
453 $ilDB = $DIC->database();
454
455 $query = "DELETE FROM event_participants " .
456 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
457 $res = $ilDB->manipulate($query);
458
459 return true;
460 }

References $DIC, $ilDB, and $res.

Referenced by ilObjUser\delete().

+ Here is the caller graph for this function:

◆ _getParticipated()

static ilEventParticipants::_getParticipated ( int  $a_event_id)
static

Definition at line 300 of file class.ilEventParticipants.php.

300 : array
301 {
302 global $DIC;
303
304 $ilDB = $DIC->database();
305
306 $query = "SELECT * FROM event_participants " .
307 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
308 "AND participated = 1";
309 $res = $ilDB->query($query);
310 $user_ids = [];
311 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
312 $user_ids[$row->usr_id] = $row->usr_id;
313 }
314 return $user_ids;
315 }

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo(), and ilSessionOverviewTableGUI\getItems().

+ Here is the caller graph for this function:

◆ _getRegistered()

static ilEventParticipants::_getRegistered ( int  $a_event_id)
static

Definition at line 283 of file class.ilEventParticipants.php.

283 : array
284 {
285 global $DIC;
286
287 $ilDB = $DIC->database();
288
289 $query = "SELECT * FROM event_participants " .
290 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
291 "AND registered = " . $ilDB->quote(1, 'integer');
292 $res = $ilDB->query($query);
293 $user_ids = [];
294 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
295 $user_ids[] = $row->usr_id;
296 }
297 return $user_ids;
298 }

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo().

+ Here is the caller graph for this function:

◆ _hasParticipated()

static ilEventParticipants::_hasParticipated ( int  $a_usr_id,
int  $a_event_id 
)
static

Definition at line 317 of file class.ilEventParticipants.php.

317 : bool
318 {
319 global $DIC;
320
321 $ilDB = $DIC->database();
322
323 $query = "SELECT participated FROM event_participants " .
324 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
325 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
326 $res = $ilDB->query($query);
327 if ($rec = $ilDB->fetchAssoc($res)) {
328 return (bool) $rec["participated"];
329 }
330 return false;
331 }

References $DIC, $ilDB, and $res.

Referenced by ilLPStatusEvent\determineStatus().

+ Here is the caller graph for this function:

◆ _isRegistered()

static ilEventParticipants::_isRegistered ( int  $a_usr_id,
int  $a_event_id 
)
static

Definition at line 333 of file class.ilEventParticipants.php.

333 : bool
334 {
335 global $DIC;
336
337 $ilDB = $DIC->database();
338
339 $query = "SELECT * FROM event_participants " .
340 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
341 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
342 $res = $ilDB->query($query);
343 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
344 return (bool) $row->registered;
345 }
346 return false;
347 }

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilSessionParticipants\_isParticipant(), ilLPStatusEvent\determineStatus(), ilObjSessionGUI\joinObject(), and ilObjSessionGUI\showJoinRequestButton().

+ Here is the caller graph for this function:

◆ _lookupComment()

ilEventParticipants::_lookupComment ( int  $a_event_id,
int  $a_usr_id 
)

Definition at line 428 of file class.ilEventParticipants.php.

428 : string
429 {
430 $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
431 return $lp_mark->getComment();
432 }

◆ _lookupMark()

static ilEventParticipants::_lookupMark ( int  $a_event_id,
int  $a_usr_id 
)
static

Definition at line 422 of file class.ilEventParticipants.php.

422 : string
423 {
424 $lp_mark = new ilLPMarks($a_event_id, $a_usr_id);
425 return $lp_mark->getMark();
426 }

◆ _register()

static ilEventParticipants::_register ( int  $a_usr_id,
int  $a_event_id 
)
static

Definition at line 349 of file class.ilEventParticipants.php.

349 : bool
350 {
351 global $DIC;
352
353 $ilDB = $DIC->database();
354
355 $query = "SELECT * FROM event_participants " .
356 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
357 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
358 $res = $ilDB->query($query);
359 if ($res->numRows()) {
360 $query = "UPDATE event_participants " .
361 "SET registered = '1' " .
362 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
363 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
364 } else {
365 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
366 "VALUES( " .
367 "1, " .
368 "0, " .
369 $ilDB->quote($a_event_id, 'integer') . ", " .
370 $ilDB->quote($a_usr_id, 'integer') . " " .
371 ")";
372 }
373 $res = $ilDB->manipulate($query);
374
375 // refresh learning progress status after updating participant
376 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
377
378 return true;
379 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

References $DIC, $ilDB, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by ilObjSessionGUI\joinObject(), and register().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _unregister()

static ilEventParticipants::_unregister ( int  $a_usr_id,
int  $a_event_id 
)
static

Definition at line 386 of file class.ilEventParticipants.php.

386 : bool
387 {
388 global $DIC;
389
390 $ilDB = $DIC->database();
391
392 $query = "SELECT * FROM event_participants " .
393 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
394 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
395 $res = $ilDB->query($query);
396 if ($res->numRows()) {
397 $query = "UPDATE event_participants " .
398 "SET registered = 0 " .
399 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
400 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
401 } else {
402 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
403 "VALUES( " .
404 "0, " .
405 "0, " .
406 $ilDB->quote($a_event_id, 'integer') . ", " .
407 $ilDB->quote($a_usr_id, 'integer') . " " .
408 ")";
409 }
410 $res = $ilDB->manipulate($query);
411
412 // refresh learning progress status after updating participant
413 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
414 return true;
415 }

References $DIC, $ilDB, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by ilObjSessionGUI\joinObject(), and unregister().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateParticipation()

static ilEventParticipants::_updateParticipation ( int  $a_usr_id,
int  $a_event_id,
bool  $a_status 
)
static

Definition at line 251 of file class.ilEventParticipants.php.

251 : bool
252 {
253 global $DIC;
254
255 $ilDB = $DIC->database();
256
257 $query = "SELECT * FROM event_participants " .
258 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
259 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
260 $res = $ilDB->query($query);
261 if ($res->numRows()) {
262 $query = "UPDATE event_participants " .
263 "SET participated = " . $ilDB->quote((int) $a_status, 'integer') . " " .
264 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
265 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
266 } else {
267 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
268 "VALUES( " .
269 $ilDB->quote(0, 'integer') . ", " .
270 $ilDB->quote((int) $a_status, 'integer') . ", " .
271 $ilDB->quote($a_event_id, 'integer') . ", " .
272 $ilDB->quote($a_usr_id, 'integer') . " " .
273 ")";
274 }
275 $res = $ilDB->manipulate($query);
276
277 // refresh learning progress status after updating participant
278 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
279
280 return true;
281 }

References $DIC, $ilDB, $res, and ilLPStatusWrapper\_updateStatus().

Referenced by updateParticipation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComment()

ilEventParticipants::getComment ( )

Definition at line 80 of file class.ilEventParticipants.php.

80 : string
81 {
82 return $this->comment;
83 }

References $comment.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getContact()

ilEventParticipants::getContact ( )

Definition at line 130 of file class.ilEventParticipants.php.

130 : int
131 {
132 return $this->contact;
133 }

References $contact.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getEventId()

ilEventParticipants::getEventId ( )

Definition at line 115 of file class.ilEventParticipants.php.

115 : int
116 {
117 return $this->event_id;
118 }

References $event_id.

Referenced by __read(), register(), unregister(), updateParticipation(), and updateUser().

+ Here is the caller graph for this function:

◆ getExcused()

ilEventParticipants::getExcused ( )

Definition at line 110 of file class.ilEventParticipants.php.

110 : bool
111 {
112 return $this->excused;
113 }

References $excused.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getMark()

ilEventParticipants::getMark ( )

Definition at line 70 of file class.ilEventParticipants.php.

70 : string
71 {
72 return $this->mark;
73 }

References $mark.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

Definition at line 220 of file class.ilEventParticipants.php.

220 : array
221 {
222 return $this->participants;
223 }

References $participants.

◆ getParticipated()

ilEventParticipants::getParticipated ( )

Definition at line 90 of file class.ilEventParticipants.php.

90 : bool
91 {
93 }

References $participated.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getParticipatedParticipants()

ilEventParticipants::getParticipatedParticipants ( )

Definition at line 149 of file class.ilEventParticipants.php.

149 : array
150 {
152 }

References $participants_participated.

◆ getRegistered()

ilEventParticipants::getRegistered ( )

Definition at line 100 of file class.ilEventParticipants.php.

100 : bool
101 {
102 return $this->registered;
103 }

References $registered.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getRegisteredParticipants()

ilEventParticipants::getRegisteredParticipants ( )

Definition at line 157 of file class.ilEventParticipants.php.

157 : array
158 {
160 }

References $participants_registered.

Referenced by ilObjSessionGUI\registerObject(), and ilObjSessionGUI\showJoinRequestButton().

+ Here is the caller graph for this function:

◆ getUser()

ilEventParticipants::getUser ( int  $a_usr_id)

Definition at line 215 of file class.ilEventParticipants.php.

215 : array
216 {
217 return $this->participants[$a_usr_id] ?? [];
218 }

◆ getUserId()

ilEventParticipants::getUserId ( )

Definition at line 60 of file class.ilEventParticipants.php.

60 : int
61 {
62 return $this->user_id;
63 }

References $user_id.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ hasParticipated()

ilEventParticipants::hasParticipated ( int  $a_usr_id)

Definition at line 230 of file class.ilEventParticipants.php.

230 : bool
231 {
232 return (bool) ($this->participants[$a_usr_id]['participated'] ?? false);
233 }

Referenced by ilObjSessionGUI\eventsListObject().

+ Here is the caller graph for this function:

◆ isContact()

ilEventParticipants::isContact ( int  $a_usr_id)

Definition at line 240 of file class.ilEventParticipants.php.

240 : bool
241 {
242 return (bool) ($this->participants[$a_usr_id]['contact'] ?? false);
243 }

◆ isExcused()

ilEventParticipants::isExcused ( int  $a_usr_id)

Definition at line 235 of file class.ilEventParticipants.php.

235 : bool
236 {
237 return (bool) ($this->participants[$a_usr_id]['excused'] ?? false);
238 }

Referenced by ilObjSessionGUI\showJoinRequestButton().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilEventParticipants::isNotificationEnabled ( )

Definition at line 135 of file class.ilEventParticipants.php.

135 : bool
136 {
138 }

References $notificationEnabled.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ isRegistered()

ilEventParticipants::isRegistered ( int  $a_usr_id)

Definition at line 225 of file class.ilEventParticipants.php.

225 : bool
226 {
227 return (bool) ($this->participants[$a_usr_id]['registered'] ?? false);
228 }

◆ register()

ilEventParticipants::register ( int  $a_usr_id)

Definition at line 381 of file class.ilEventParticipants.php.

381 : bool
382 {
383 return ilEventParticipants::_register($a_usr_id, $this->getEventId());
384 }
static _register(int $a_usr_id, int $a_event_id)

References _register(), and getEventId().

+ Here is the call graph for this function:

◆ setComment()

ilEventParticipants::setComment ( string  $a_comment)

Definition at line 75 of file class.ilEventParticipants.php.

75 : void
76 {
77 $this->comment = $a_comment;
78 }

References ILIAS\UI\examples\Symbol\Glyph\Comment\comment().

+ Here is the call graph for this function:

◆ setContact()

ilEventParticipants::setContact ( bool  $a_status)

Definition at line 125 of file class.ilEventParticipants.php.

125 : void
126 {
127 $this->contact = (int) $a_status;
128 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ setEventId()

ilEventParticipants::setEventId ( int  $a_event_id)

Definition at line 120 of file class.ilEventParticipants.php.

120 : void
121 {
122 $this->event_id = $a_event_id;
123 }

◆ setExcused()

ilEventParticipants::setExcused ( bool  $a_stat)

Definition at line 105 of file class.ilEventParticipants.php.

105 : void
106 {
107 $this->excused = $a_stat;
108 }

◆ setMark()

ilEventParticipants::setMark ( string  $a_mark)

Definition at line 65 of file class.ilEventParticipants.php.

65 : void
66 {
67 $this->mark = $a_mark;
68 }

◆ setNotificationEnabled()

ilEventParticipants::setNotificationEnabled ( bool  $value)

Definition at line 140 of file class.ilEventParticipants.php.

140 : void
141 {
142 $this->notificationEnabled = $value;
143 }

◆ setParticipated()

ilEventParticipants::setParticipated ( bool  $a_status)

Definition at line 85 of file class.ilEventParticipants.php.

86 {
87 $this->participated = $a_status;
88 }

◆ setParticipatedParticipants()

ilEventParticipants::setParticipatedParticipants ( array  $participants_participated)

Definition at line 145 of file class.ilEventParticipants.php.

145 : void
146 {
147 $this->participants_participated = $participants_participated;
148 }

References $participants_participated.

◆ setRegistered()

ilEventParticipants::setRegistered ( bool  $a_status)

Definition at line 95 of file class.ilEventParticipants.php.

95 : void
96 {
97 $this->registered = $a_status;
98 }

◆ setRegisteredParticipants()

ilEventParticipants::setRegisteredParticipants ( array  $registered_participants)

Definition at line 153 of file class.ilEventParticipants.php.

153 : void
154 {
155 $this->participants_registered = $registered_participants;
156 }

◆ setUserId()

ilEventParticipants::setUserId ( int  $a_usr_id)

Definition at line 55 of file class.ilEventParticipants.php.

55 : void
56 {
57 $this->user_id = $a_usr_id;
58 }

◆ unregister()

ilEventParticipants::unregister ( int  $a_usr_id)

Definition at line 417 of file class.ilEventParticipants.php.

417 : bool
418 {
419 return self::_unregister($a_usr_id, $this->getEventId());
420 }
static _unregister(int $a_usr_id, int $a_event_id)

References _unregister(), and getEventId().

+ Here is the call graph for this function:

◆ updateExcusedForUser()

ilEventParticipants::updateExcusedForUser ( int  $a_usr_id,
bool  $a_status 
)

Definition at line 162 of file class.ilEventParticipants.php.

162 : void
163 {
164 if (!array_key_exists($a_usr_id, $this->participants)) {
165 $event_part = new \ilEventParticipants($this->event_id);
166 $event_part->setUserId($a_usr_id);
167 $event_part->setMark('');
168 $event_part->setComment('');
169 $event_part->setNotificationEnabled(false);
170 $event_part->setParticipated(false);
171 $event_part->setRegistered(false);
172 $event_part->setContact(false);
173 $event_part->setExcused($a_status);
174 $event_part->updateUser();
175 return;
176 }
177
178 $query = 'update event_participants set excused = ' . $this->db->quote($a_status, \ilDBConstants::T_INTEGER) . ' ' .
179 'where event_id = ' . $this->db->quote($this->event_id, \ilDBConstants::T_INTEGER) . ' and ' .
180 'usr_id = ' . $this->db->quote($a_usr_id, \ilDBConstants::T_INTEGER);
181 $this->db->manipulate($query);
182 }

References ilDBConstants\T_INTEGER.

Referenced by ilObjSessionGUI\registerObject(), and ilObjSessionGUI\unregisterObject().

+ Here is the caller graph for this function:

◆ updateParticipation()

ilEventParticipants::updateParticipation ( int  $a_usr_id,
bool  $a_status 
)

Definition at line 246 of file class.ilEventParticipants.php.

246 : bool
247 {
248 return self::_updateParticipation($a_usr_id, $this->getEventId(), $a_status);
249 }
static _updateParticipation(int $a_usr_id, int $a_event_id, bool $a_status)

References _updateParticipation(), and getEventId().

+ Here is the call graph for this function:

◆ updateUser()

ilEventParticipants::updateUser ( )

Definition at line 184 of file class.ilEventParticipants.php.

184 : bool
185 {
187
188 $query = "DELETE FROM event_participants " .
189 "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " " .
190 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
191 $res = $ilDB->manipulate($query);
192
193 $query = "INSERT INTO event_participants (event_id,usr_id,registered,participated,contact,notification_enabled, excused " .
194 ") VALUES( " .
195 $ilDB->quote($this->getEventId(), 'integer') . ", " .
196 $ilDB->quote($this->getUserId(), 'integer') . ", " .
197 $ilDB->quote((int) $this->getRegistered(), 'integer') . ", " .
198 $ilDB->quote((int) $this->getParticipated(), 'integer') . ', ' .
199 $ilDB->quote($this->getContact(), 'integer') . ', ' .
200 $ilDB->quote((int) $this->isNotificationEnabled(), 'integer') . ', ' .
201 $ilDB->quote((int) $this->getExcused(), 'integer') .
202 ")";
203 $res = $ilDB->manipulate($query);
204
205 $lp_mark = new ilLPMarks($this->getEventId(), $this->getUserId());
206 $lp_mark->setComment($this->getComment());
207 $lp_mark->setMark($this->getMark());
208 $lp_mark->update();
209
210 // refresh learning progress status after updating participant
212 return true;
213 }

References $db, $ilDB, $res, ilLPStatusWrapper\_updateStatus(), getComment(), getContact(), getEventId(), getExcused(), getMark(), getParticipated(), getRegistered(), getUserId(), and isNotificationEnabled().

+ Here is the call graph for this function:

Field Documentation

◆ $comment

string ilEventParticipants::$comment = ""
protected

Definition at line 40 of file class.ilEventParticipants.php.

Referenced by getComment().

◆ $contact

int ilEventParticipants::$contact = 0
protected

Definition at line 32 of file class.ilEventParticipants.php.

Referenced by getContact().

◆ $db

ilDBInterface ilEventParticipants::$db
protected

Definition at line 30 of file class.ilEventParticipants.php.

Referenced by __read(), and updateUser().

◆ $event_id

int ilEventParticipants::$event_id = 0
protected

Definition at line 36 of file class.ilEventParticipants.php.

Referenced by getEventId().

◆ $excused

bool ilEventParticipants::$excused = false
protected

Definition at line 35 of file class.ilEventParticipants.php.

Referenced by getExcused().

◆ $mark

string ilEventParticipants::$mark = ""
protected

Definition at line 39 of file class.ilEventParticipants.php.

Referenced by getMark().

◆ $notificationEnabled

bool ilEventParticipants::$notificationEnabled = false
protected

Definition at line 37 of file class.ilEventParticipants.php.

Referenced by isNotificationEnabled().

◆ $participants

array ilEventParticipants::$participants = []
protected

Definition at line 41 of file class.ilEventParticipants.php.

Referenced by __read(), and getParticipants().

◆ $participants_participated

array ilEventParticipants::$participants_participated = []
protected

◆ $participants_registered

array ilEventParticipants::$participants_registered = []
protected

Definition at line 42 of file class.ilEventParticipants.php.

Referenced by getRegisteredParticipants().

◆ $participated

bool ilEventParticipants::$participated = false
protected

Definition at line 34 of file class.ilEventParticipants.php.

Referenced by getParticipated().

◆ $registered

bool ilEventParticipants::$registered = false
protected

Definition at line 33 of file class.ilEventParticipants.php.

Referenced by getRegistered().

◆ $tree

ilTree ilEventParticipants::$tree
protected

Definition at line 31 of file class.ilEventParticipants.php.

Referenced by __read().

◆ $user_id

int ilEventParticipants::$user_id = 0
protected

Definition at line 38 of file class.ilEventParticipants.php.

Referenced by getUserId().


The documentation for this class was generated from the following file: