ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilStudyProgrammeEvents.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2015 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4/* Copyright (c) 2019 Stefan Hecken <stefan.hecken@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5
6declare(strict_types=1);
7
9{
10 const COMPONENT = "Modules/StudyProgramme";
11
16
21
22 public function __construct(
25 ) {
26 $this->app_event_handler = $app_event_handler;
27 $this->assignment_repo = $assignment_repo;
28 }
29
30 public function raise($a_event, $a_parameter) : void
31 {
32 $this->app_event_handler->raise(self::COMPONENT, $a_event, $a_parameter);
33 }
34
38 public function userAssigned(ilStudyProgrammeUserAssignment $a_assignment) : void
39 {
40 $this->raise(
41 "userAssigned",
42 [
43 "root_prg_id" => $a_assignment->getStudyProgramme()->getId(),
44 "usr_id" => $a_assignment->getUserId(),
45 "ass_id" => $a_assignment->getId()
46 ]
47 );
48 }
49
53 public function userReAssigned(ilStudyProgrammeUserAssignment $a_assignment) : void
54 {
55 $this->raise(
56 "userReAssigned",
57 [
58 "root_prg_ref_id" => (int) $a_assignment->getStudyProgramme()->getRefId(),
59 "usr_id" => (int) $a_assignment->getUserId()
60 ]
61 );
62 }
63
67 public function userDeassigned(ilStudyProgrammeUserAssignment $a_assignment) : void
68 {
69 $this->raise(
70 "userDeassigned",
71 [
72 "root_prg_id" => $a_assignment->getStudyProgramme()->getId(),
73 "usr_id" => $a_assignment->getUserId(),
74 "ass_id" => $a_assignment->getId()
75 ]
76 );
77 }
78
82 public function userSuccessful(ilStudyProgrammeUserProgress $a_progress) : void
83 {
84 $ass = $this->assignment_repo->read($a_progress->getAssignmentId());
85 $this->raise(
86 "userSuccessful",
87 [
88 "root_prg_id" => $ass->getRootId(),
89 "prg_id" => $a_progress->getStudyProgramme()->getId(),
90 "usr_id" => $ass->getUserId(),
91 "ass_id" => $ass->getId()
92 ]
93 );
94 }
95
100 {
101 $this->raise(
102 'informUserToRestart',
103 [
104 "usr_id" => (int) $assignment->getUserId(),
105 "ass_id" => (int) $assignment->getId()
106 ]
107 );
108 }
109
110 public function userRiskyToFail(ilStudyProgrammeUserProgress $a_progress) : void
111 {
112 $ass = $this->assignment_repo->read($a_progress->getAssignmentId());
113 $this->raise(
114 "userRiskyToFail",
115 [
116 "progress_id" => $a_progress->getId(),
117 "usr_id" => $ass->getUserId()
118 ]
119 );
120 }
121}
An exception for terminatinating execution or to throw for unit testing.
Global event handler.
userDeassigned(ilStudyProgrammeUserAssignment $a_assignment)
userSuccessful(ilStudyProgrammeUserProgress $a_progress)
userReAssigned(ilStudyProgrammeUserAssignment $a_assignment)
__construct(\ilAppEventHandler $app_event_handler, \ilStudyProgrammeAssignmentRepository $assignment_repo)
userRiskyToFail(ilStudyProgrammeUserProgress $a_progress)
userAssigned(ilStudyProgrammeUserAssignment $a_assignment)
informUserByMailToRestart(ilStudyProgrammeUserAssignment $assignment)
Represents one assignment of a user to a study programme.
getStudyProgramme()
Get the program node where this assignment was made.
Represents the progress of a user at one node of a study programme.
getAssignmentId()
Get the assignment this progress belongs to.
getStudyProgramme()
Get the program node this progress belongs to.