ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGroupAppEventListener Class Reference

Group Pool listener. More...

+ Collaboration diagram for ilGroupAppEventListener:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getLogger ()
 

Static Public Member Functions

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

Protected Member Functions

 handleUserAssignments (string $a_event, array $a_parameters)
 

Static Protected Member Functions

static doAutoFill (int $a_obj_id)
 Trigger autofill from waiting list. More...
 

Private Attributes

ilLogger $logger
 

Detailed Description

Group Pool listener.

Listens to events of other components.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 12 of file class.ilGroupAppEventListener.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupAppEventListener::__construct ( )

Constructor.

Definition at line 19 of file class.ilGroupAppEventListener.php.

References $DIC, and ILIAS\Repository\logger().

20  {
21  global $DIC;
22 
23  $this->logger = $DIC->logger()->grp();
24  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ doAutoFill()

static ilGroupAppEventListener::doAutoFill ( int  $a_obj_id)
staticprotected

Trigger autofill from waiting list.

Definition at line 64 of file class.ilGroupAppEventListener.php.

References $DIC, $ref_id, ilObject\_getAllReferences(), ilObjectFactory\getInstanceByRefId(), and ilLogger\warning().

64  : void
65  {
66  global $DIC;
67 
68  $logger = $DIC->logger()->grp();
69  $refs = ilObject::_getAllReferences($a_obj_id);
70  $ref_id = end($refs);
71 
73  if (!$group instanceof ilObjGroup) {
74  $logger->warning('Cannot handle event deassign user since passed obj_id is not of type group: ' . $a_obj_id);
75  }
76  $group->handleAutoFill();
77  }
warning(string $a_message)
static _getAllReferences(int $id)
get all reference ids for object ID
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjGroup.
+ Here is the call graph for this function:

◆ getLogger()

ilGroupAppEventListener::getLogger ( )

Definition at line 28 of file class.ilGroupAppEventListener.php.

References $logger.

Referenced by handleUserAssignments().

28  : ilLogger
29  {
30  return $this->logger;
31  }
+ Here is the caller graph for this function:

◆ handleEvent()

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

Handle an event in a listener.

Parameters
string$a_componentcomponent, e.g. "Modules/Forum" or "Services/User"
string$a_eventevent e.g. "createUser", "updateUser", "deleteUser", ...
array$a_parameterparameter array (assoc), array("name" => ..., "phone_office" => ...)

Definition at line 86 of file class.ilGroupAppEventListener.php.

86  : void
87  {
88  if ($a_component == 'Services/AccessControl') {
89  $listener = new self();
90  $listener->handleUserAssignments($a_event, $a_parameter);
91  }
92  }

◆ handleUserAssignments()

ilGroupAppEventListener::handleUserAssignments ( string  $a_event,
array  $a_parameters 
)
protected

Definition at line 33 of file class.ilGroupAppEventListener.php.

References getLogger(), and ilParticipant\updateMemberRoles().

33  : void
34  {
35  if ($a_parameters['type'] != 'grp') {
36  $this->getLogger()->debug('Ignoring event for type ' . $a_parameters['type']);
37  return;
38  }
39 
40  if ($a_event == 'assignUser') {
41  $this->getLogger()->debug('Handling assign user event for type grp.');
42  $new_status = 1;
43  } elseif ($a_event == 'deassignUser') {
44  $this->getLogger()->debug('Handling assign user event for type grp.');
45  $new_status = 0;
46  } else {
47  return;
48  }
50  (int) $a_parameters['obj_id'],
51  (int) $a_parameters['usr_id'],
52  (int) $a_parameters['role_id'],
53  $new_status
54  );
55 
56  if ($a_event == 'deassignUser') {
57  self::doAutoFill((int) $a_parameters['obj_id']);
58  }
59  }
static updateMemberRoles(int $a_obj_id, int $a_usr_id, int $a_role_id, int $a_status)
+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilGroupAppEventListener::$logger
private

Definition at line 14 of file class.ilGroupAppEventListener.php.

Referenced by getLogger().


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