ILIAS  release_8 Revision v8.24
ilEventParticipants Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 29 of file class.ilEventParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilEventParticipants::__construct ( int  $a_event_id)

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

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

References $DIC, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilEventParticipants::__read ( )
protected

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

463 : void
464 {
465 global $DIC;
466
469
470 $query = "SELECT * FROM event_participants " .
471 "WHERE event_id = " . $ilDB->quote($this->getEventId(), 'integer') . " ";
472 $res = $this->db->query($query);
473
474 $parentRecipients = [];
475 $parentParticipants = [];
477 $refIdArray = array_values(ilObject::_getAllReferences($this->event_id));
478 if (true === $session->isRegistrationNotificationEnabled()) {
479 if (ilSessionConstants::NOTIFICATION_INHERIT_OPTION === $session->getRegistrationNotificationOption()) {
480 $parentRefId = $tree->checkForParentType($refIdArray[0], 'grp');
481 if (!$parentRefId) {
482 $parentRefId = $tree->checkForParentType($refIdArray[0], 'crs');
483 }
484 if ($parentRefId) {
486 $parentRecipients = $participants->getNotificationRecipients();
487 $parentParticipants = $participants->getParticipants();
488 }
489 }
490 }
491 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
492 $this->participants[(int) $row->usr_id]['usr_id'] = (int) $row->usr_id;
493 $this->participants[(int) $row->usr_id]['registered'] = (bool) $row->registered;
494 $this->participants[(int) $row->usr_id]['participated'] = (bool) $row->participated;
495 $this->participants[(int) $row->usr_id]['excused'] = (bool) $row->excused;
496 $this->participants[(int) $row->usr_id]['contact'] = (bool) $row->contact;
497
498 $lp_mark = new ilLPMarks($this->getEventId(), (int) $row->usr_id);
499 $this->participants[(int) $row->usr_id]['mark'] = $lp_mark->getMark();
500 $this->participants[(int) $row->usr_id]['comment'] = $lp_mark->getComment();
501
502 if (
503 $session->isRegistrationNotificationEnabled() &&
504 $session->getRegistrationNotificationOption() === ilSessionConstants::NOTIFICATION_MANUAL_OPTION
505 ) {
506 $this->participants[(int) $row->usr_id]['notification_enabled'] = (bool) $row->notification_enabled;
507 } elseif (in_array((int) $row->usr_id, $parentRecipients)) {
508 $this->participants[(int) $row->usr_id]['notification_enabled'] = true;
509 } else {
510 $this->participants[(int) $row->usr_id]['notification_enabled'] = false;
511 }
512 if ($row->registered) {
513 $this->participants_registered[] = (int) $row->usr_id;
514 }
515 if ($row->participated) {
516 $this->participants_participated[] = (int) $row->usr_id;
517 }
518 }
519 // add defaults for parent participants
520 foreach ($parentParticipants as $usr_id) {
521 if (isset($this->participants[$usr_id])) {
522 continue;
523 }
524 $this->participants[$usr_id]['usr_id'] = (int) $usr_id;
525 $this->participants[$usr_id]['registered'] = false;
526 $this->participants[$usr_id]['participated'] = false;
527 $this->participants[$usr_id]['excused'] = false;
528 $this->participants[$usr_id]['contact'] = false;
529 $lp_mark = new ilLPMarks($this->getEventId(), $usr_id);
530 $this->participants[$usr_id]['mark'] = $lp_mark->getMark();
531 $this->participants[$usr_id]['comment'] = $lp_mark->getComment();
532 $this->participants[$usr_id]['notification_enabled'] = false;
533 if (in_array($usr_id, $parentRecipients)) {
534 $this->participants[$usr_id]['notification_enabled'] = true;
535 }
536 }
537 }
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
$query
$session

References $db, $DIC, $ilDB, $participants, $query, $res, $session, $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 435 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 450 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, 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 301 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 284 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 318 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, 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 334 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 429 of file class.ilEventParticipants.php.

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

◆ _lookupMark()

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

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

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

◆ _register()

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

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

350 : bool
351 {
352 global $DIC;
353
354 $ilDB = $DIC->database();
355
356 $query = "SELECT * FROM event_participants " .
357 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
358 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
359 $res = $ilDB->query($query);
360 if ($res->numRows()) {
361 $query = "UPDATE event_participants " .
362 "SET registered = '1' " .
363 "WHERE event_id = " . $ilDB->quote($a_event_id, 'integer') . " " .
364 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
365 } else {
366 $query = "INSERT INTO event_participants (registered,participated,event_id,usr_id) " .
367 "VALUES( " .
368 "1, " .
369 "0, " .
370 $ilDB->quote($a_event_id, 'integer') . ", " .
371 $ilDB->quote($a_usr_id, 'integer') . " " .
372 ")";
373 }
374 $res = $ilDB->manipulate($query);
375
376 // refresh learning progress status after updating participant
377 ilLPStatusWrapper::_updateStatus($a_event_id, $a_usr_id);
378
379 return true;
380 }
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, $query, $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 387 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 252 of file class.ilEventParticipants.php.

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

References $DIC, $ilDB, $query, $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 81 of file class.ilEventParticipants.php.

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

References $comment.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getContact()

ilEventParticipants::getContact ( )

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

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

References $contact.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getEventId()

ilEventParticipants::getEventId ( )

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

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

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 111 of file class.ilEventParticipants.php.

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

References $excused.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getMark()

ilEventParticipants::getMark ( )

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

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

References $mark.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getParticipants()

ilEventParticipants::getParticipants ( )

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

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

References $participants.

◆ getParticipated()

ilEventParticipants::getParticipated ( )

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

91 : bool
92 {
94 }

References $participated.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getParticipatedParticipants()

ilEventParticipants::getParticipatedParticipants ( )

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

150 : array
151 {
153 }

References $participants_participated.

◆ getRegistered()

ilEventParticipants::getRegistered ( )

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

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

References $registered.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ getRegisteredParticipants()

ilEventParticipants::getRegisteredParticipants ( )

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

158 : array
159 {
161 }

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 216 of file class.ilEventParticipants.php.

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

◆ getUserId()

ilEventParticipants::getUserId ( )

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

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

References $user_id.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ hasParticipated()

ilEventParticipants::hasParticipated ( int  $a_usr_id)

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

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

Referenced by ilObjSessionGUI\eventsListObject().

+ Here is the caller graph for this function:

◆ isContact()

ilEventParticipants::isContact ( int  $a_usr_id)

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

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

◆ isExcused()

ilEventParticipants::isExcused ( int  $a_usr_id)

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

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

Referenced by ilObjSessionGUI\showJoinRequestButton().

+ Here is the caller graph for this function:

◆ isNotificationEnabled()

ilEventParticipants::isNotificationEnabled ( )

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

136 : bool
137 {
139 }

References $notificationEnabled.

Referenced by updateUser().

+ Here is the caller graph for this function:

◆ isRegistered()

ilEventParticipants::isRegistered ( int  $a_usr_id)

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

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

◆ register()

ilEventParticipants::register ( int  $a_usr_id)

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

382 : bool
383 {
384 return ilEventParticipants::_register($a_usr_id, $this->getEventId());
385 }
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 76 of file class.ilEventParticipants.php.

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

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 126 of file class.ilEventParticipants.php.

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

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ setEventId()

ilEventParticipants::setEventId ( int  $a_event_id)

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

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

◆ setExcused()

ilEventParticipants::setExcused ( bool  $a_stat)

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

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

◆ setMark()

ilEventParticipants::setMark ( string  $a_mark)

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

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

◆ setNotificationEnabled()

ilEventParticipants::setNotificationEnabled ( bool  $value)

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

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

◆ setParticipated()

ilEventParticipants::setParticipated ( bool  $a_status)

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

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

◆ setParticipatedParticipants()

ilEventParticipants::setParticipatedParticipants ( array  $participants_participated)

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

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

References $participants_participated.

◆ setRegistered()

ilEventParticipants::setRegistered ( bool  $a_status)

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

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

◆ setRegisteredParticipants()

ilEventParticipants::setRegisteredParticipants ( array  $registered_participants)

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

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

◆ setUserId()

ilEventParticipants::setUserId ( int  $a_usr_id)

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

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

◆ unregister()

ilEventParticipants::unregister ( int  $a_usr_id)

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

418 : bool
419 {
420 return self::_unregister($a_usr_id, $this->getEventId());
421 }
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 163 of file class.ilEventParticipants.php.

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

References $query, and 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 247 of file class.ilEventParticipants.php.

247 : bool
248 {
249 return self::_updateParticipation($a_usr_id, $this->getEventId(), $a_status);
250 }
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 185 of file class.ilEventParticipants.php.

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

References $db, $ilDB, $query, $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 41 of file class.ilEventParticipants.php.

Referenced by getComment().

◆ $contact

int ilEventParticipants::$contact = 0
protected

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

Referenced by getContact().

◆ $db

ilDBInterface ilEventParticipants::$db
protected

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

Referenced by __read(), and updateUser().

◆ $event_id

int ilEventParticipants::$event_id = 0
protected

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

Referenced by getEventId().

◆ $excused

bool ilEventParticipants::$excused = false
protected

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

Referenced by getExcused().

◆ $mark

string ilEventParticipants::$mark = ""
protected

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

Referenced by getMark().

◆ $notificationEnabled

bool ilEventParticipants::$notificationEnabled = false
protected

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

Referenced by isNotificationEnabled().

◆ $participants

array ilEventParticipants::$participants = []
protected

Definition at line 42 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 43 of file class.ilEventParticipants.php.

Referenced by getRegisteredParticipants().

◆ $participated

bool ilEventParticipants::$participated = false
protected

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

Referenced by getParticipated().

◆ $registered

bool ilEventParticipants::$registered = false
protected

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

Referenced by getRegistered().

◆ $tree

ilTree ilEventParticipants::$tree
protected

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

Referenced by __read().

◆ $user_id

int ilEventParticipants::$user_id = 0
protected

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

Referenced by getUserId().


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