ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilRepositoryAppEventListener Class Reference

Repository app event listener. More...

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

Static Public Member Functions

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

Detailed Description

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 11 of file class.ilRepositoryAppEventListener.php.

Member Function Documentation

◆ handleEvent()

static ilRepositoryAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_params 
)
static

@inheritDoc

Implements ilAppEventListener.

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

17 {
18 switch ($a_component) {
19 case "Services/Object":
20 switch ($a_event) {
21 case "deleteReference":
22 // remove recommended content
23 $rec_manager = new ilRecommendedContentManager();
24 $rec_manager->removeRecommendationsOfRefId((int) $a_params["ref_id"]);
25
26 // remove favourites
27 $rec_manager = new ilFavouritesManager();
28 $rec_manager->removeFavouritesOfRefId((int) $a_params["ref_id"]);
29 break;
30
31 case "beforeDeletion":
32
33
34 if ($a_params["object"]->getType() == "usr") {
35
36 // remove recommended content
37 $rec_manager = new ilRecommendedContentManager();
38 $rec_manager->removeRecommendationsOfUser((int) $a_params["object"]->getId());
39
40 // remove favourites
41 $rec_manager = new ilFavouritesManager();
42 $rec_manager->removeFavouritesOfUser((int) $a_params["object"]->getId());
43 }
44
45 if ($a_params["object"]->getType() == "role") {
46
47 // remove recommended content
48 $rec_manager = new ilRecommendedContentManager();
49 $rec_manager->removeRecommendationsOfRole((int) $a_params["object"]->getId());
50 }
51 break;
52 }
53 break;
54 }
55
56 return true;
57 }
Manages favourites, currently the interface for other components, needs discussion.
Recommended content manager (business logic)

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