ILIAS  release_8 Revision v8.24
ilRepositoryAppEventListener Class Reference

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

+ Inheritance diagram for ilRepositoryAppEventListener:
+ Collaboration diagram for ilRepositoryAppEventListener:

Static Public Member Functions

static handleEvent (string $a_component, string $a_event, array $a_parameter)
 @inheritDoc More...
 
static handleEvent (string $a_component, string $a_event, array $a_parameter)
 Handle an event in a listener. More...
 

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 Repository app event listener

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilRepositoryAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilRepositoryAppEventListener::handleEvent ( string  $a_component,
string  $a_event,
array  $a_parameter 
)
static

@inheritDoc

Implements ilAppEventListener.

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

31 : void
32 {
33 switch ($a_component) {
34 case "Services/Object":
35 switch ($a_event) {
36 case "deleteReference":
37 // remove recommended content
38 $rec_manager = new ilRecommendedContentManager();
39 $rec_manager->removeRecommendationsOfRefId((int) $a_parameter["ref_id"]);
40
41 // remove favourites
42 $rec_manager = new ilFavouritesManager();
43 $rec_manager->removeFavouritesOfRefId((int) $a_parameter["ref_id"]);
44 break;
45
46 case "beforeDeletion":
47
48
49 if ($a_parameter["object"]->getType() === "usr") {
50
51 // remove recommended content
52 $rec_manager = new ilRecommendedContentManager();
53 $rec_manager->removeRecommendationsOfUser((int) $a_parameter["object"]->getId());
54
55 // remove favourites
56 $rec_manager = new ilFavouritesManager();
57 $rec_manager->removeFavouritesOfUser((int) $a_parameter["object"]->getId());
58 }
59
60 if ($a_parameter["object"]->getType() === "role") {
61
62 // remove recommended content
63 $rec_manager = new ilRecommendedContentManager();
64 $rec_manager->removeRecommendationsOfRole((int) $a_parameter["object"]->getId());
65 }
66 break;
67 }
68 break;
69 }
70 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

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