Handles delete events from courses and categories.
More...
|
static | handleEvent (string $a_component, string $a_event, array $a_parameter) |
| Handle an event in a listener. More...
|
|
static | deleteReferences (int $a_target_id) |
|
static | handleEvent (string $a_component, string $a_event, array $a_parameter) |
| Handle an event in a listener. More...
|
|
Handles delete events from courses and categories.
- Author
- Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Definition at line 26 of file class.ilContainerReferenceAppEventListener.php.
◆ deleteReferences()
static ilContainerReferenceAppEventListener::deleteReferences |
( |
int |
$a_target_id | ) |
|
|
static |
Definition at line 49 of file class.ilContainerReferenceAppEventListener.php.
49 : void
50 {
52
53 $ilLog =
$DIC[
"ilLog"];
54 $ilAppEventHandler =
$DIC[
"ilAppEventHandler"];
56
58 return;
59 }
62 continue;
63 }
64 $type = $instance->getType();
65 switch ($type) {
66 case 'grpr':
67 case 'crsr':
68 case 'catr':
69 case 'prgr':
70 $parent_id = $tree->getParentId(
$ref_id);
71 $instance->delete();
72 $ilLog->write(__METHOD__ . ': Deleted reference object of type ' . $instance->getType() . ' with Id ' . $instance->getId());
73 $ilAppEventHandler->raise(
74 'components/ILIAS/ContainerReference',
75 'deleteReference',
76 [
78 'old_parent_ref_id' => $parent_id,
79 'type' => $type
80 ]
81 );
82 break;
83
84 default:
85 $ilLog->write(__METHOD__ . ': Unexpected object type ' . $instance->getType() . ' with Id ' . $instance->getId());
86 break;
87 }
88 }
89 }
static _lookupSourceId(int $a_target_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences(int $id)
get all reference ids for object ID
References $DIC, $ref_id, ilObject\_getAllReferences(), ilContainerReference\_lookupSourceId(), and ilObjectFactory\getInstanceByRefId().
Referenced by handleEvent().
◆ handleEvent()
static ilContainerReferenceAppEventListener::handleEvent |
( |
string |
$a_component, |
|
|
string |
$a_event, |
|
|
array |
$a_parameter |
|
) |
| |
|
static |
Handle an event in a listener.
- Parameters
-
string | $a_component | component, e.g. "components/ILIAS/Forum" or "components/ILIAS/User" |
string | $a_event | event e.g. "createUser", "updateUser", "deleteUser", ... |
| array<string,mixed> | $a_parameter parameter array (assoc), array("name" => ..., "phone_office" => ...) |
Implements ilAppEventListener.
Definition at line 28 of file class.ilContainerReferenceAppEventListener.php.
28 : void
29 {
31
32 $ilLog =
$DIC[
"ilLog"];
33
34 switch ($a_component) {
35 case 'components/ILIAS/Course':
36 case 'components/ILIAS/Group':
37 case 'components/ILIAS/Category':
38 case 'components/ILIAS/StudyProgramme':
39 switch ($a_event) {
40 case 'delete':
41 $ilLog->write(__METHOD__ . ': Handling delete event.');
43 break;
44 }
45 break;
46 }
47 }
static deleteReferences(int $a_target_id)
References $DIC, and deleteReferences().
The documentation for this class was generated from the following file: