ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilCourseWaitingList.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=0);
20 
27 {
28  private ilLogger $logger;
29 
30  public function __construct(int $a_obj_id)
31  {
32  global $DIC;
33 
34  $this->logger = $DIC->logger()->crs();
35  parent::__construct($a_obj_id);
36  }
37 
38  public function addToList(int $a_usr_id): bool
39  {
40  if (!parent::addToList($a_usr_id)) {
41  return false;
42  }
43  $this->logger->debug('Raise new event: Modules/Course addToList');
44  $this->eventHandler->raise(
45  "components/ILIAS/Course",
46  'addToWaitingList',
47  [
48  'obj_id' => $this->getObjId(),
49  'usr_id' => $a_usr_id
50  ]
51  );
52  return true;
53  }
54 
55  public function removeFromList(int $a_usr_id): bool
56  {
57  if (!parent::removeFromList($a_usr_id)) {
58  return false;
59  }
60  $this->logger->debug('Raise new event: Modules/Course removeFromList');
61  $this->eventHandler->raise(
62  "components/ILIAS/Course",
63  'removeFromWaitingList',
64  [
65  'obj_id' => $this->getObjId(),
66  'usr_id' => $a_usr_id
67  ]
68  );
69  return true;
70  }
71 }
Base class for course and group waiting lists.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)