ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilRepositoryAppEventListener Class Reference

Repository app event listener. More...

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

Static Public Member Functions

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

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

Member Function Documentation

◆ handleEvent()

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

Implements ilAppEventListener.

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

References ILIAS\Survey\Mode\getId().

31  : void
32  {
33  switch ($a_component) {
34  case "components/ILIAS/ILIASObject":
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  // remove recommended content
51  $rec_manager = new ilRecommendedContentManager();
52  $rec_manager->removeRecommendationsOfUser((int) $a_parameter["object"]->getId());
53 
54  // remove favourites
55  $rec_manager = new ilFavouritesManager();
56  $rec_manager->removeFavouritesOfUser((int) $a_parameter["object"]->getId());
57  }
58 
59  if ($a_parameter["object"]->getType() === "role") {
60  // remove recommended content
61  $rec_manager = new ilRecommendedContentManager();
62  $rec_manager->removeRecommendationsOfRole((int) $a_parameter["object"]->getId());
63  }
64  break;
65  }
66  break;
67  }
68  }
Manages favourites, currently the interface for other components, needs discussion.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

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