ILIAS  release_8 Revision v8.23
ilTermsOfServiceAppEventListener Class Reference

Class ilTermsOfServiceAppEventListener. More...

+ Inheritance diagram for ilTermsOfServiceAppEventListener:
+ Collaboration diagram for ilTermsOfServiceAppEventListener:

Public Member Functions

 __construct (ilTermsOfServiceHelper $helper)
 
 withComponent (string $component)
 
 withEvent (string $event)
 
 withParameters (array $parameters)
 
 handle ()
 

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

 isUserDeletionEvent ()
 

Protected Attributes

ilTermsOfServiceHelper $helper
 
string $component = ''
 
string $event = ''
 
array $parameters = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceAppEventListener::__construct ( ilTermsOfServiceHelper  $helper)

Definition at line 32 of file class.ilTermsOfServiceAppEventListener.php.

References $helper.

33  {
34  $this->helper = $helper;
35  }

Member Function Documentation

◆ handle()

ilTermsOfServiceAppEventListener::handle ( )

Definition at line 72 of file class.ilTermsOfServiceAppEventListener.php.

References isUserDeletionEvent().

72  : void
73  {
74  if ($this->isUserDeletionEvent()) {
75  $this->helper->deleteAcceptanceHistoryByUser($this->parameters['usr_id']);
76  }
77  }
+ Here is the call graph for this function:

◆ handleEvent()

static ilTermsOfServiceAppEventListener::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" => ...)

Implements ilAppEventListener.

Definition at line 79 of file class.ilTermsOfServiceAppEventListener.php.

79  : void
80  {
81  $listener = new self(new ilTermsOfServiceHelper());
82  $listener
83  ->withComponent($a_component)
84  ->withEvent($a_event)
85  ->withParameters($a_parameter)
86  ->handle();
87  }
Class ilTermsOfServiceHelper.

◆ isUserDeletionEvent()

ilTermsOfServiceAppEventListener::isUserDeletionEvent ( )
protected

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

References ILIAS\Repository\event().

Referenced by handle().

64  : bool
65  {
66  return (
67  'Services/User' === $this->component &&
68  'deleteUser' === $this->event
69  );
70  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withComponent()

ilTermsOfServiceAppEventListener::withComponent ( string  $component)

Definition at line 37 of file class.ilTermsOfServiceAppEventListener.php.

References $component.

37  : self
38  {
39  $clone = clone $this;
40 
41  $clone->component = $component;
42 
43  return $clone;
44  }

◆ withEvent()

ilTermsOfServiceAppEventListener::withEvent ( string  $event)

Definition at line 46 of file class.ilTermsOfServiceAppEventListener.php.

References $event.

46  : self
47  {
48  $clone = clone $this;
49 
50  $clone->event = $event;
51 
52  return $clone;
53  }

◆ withParameters()

ilTermsOfServiceAppEventListener::withParameters ( array  $parameters)

Definition at line 55 of file class.ilTermsOfServiceAppEventListener.php.

References $parameters.

55  : self
56  {
57  $clone = clone $this;
58 
59  $clone->parameters = $parameters;
60 
61  return $clone;
62  }

Field Documentation

◆ $component

string ilTermsOfServiceAppEventListener::$component = ''
protected

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

Referenced by withComponent().

◆ $event

string ilTermsOfServiceAppEventListener::$event = ''
protected

Definition at line 29 of file class.ilTermsOfServiceAppEventListener.php.

Referenced by withEvent().

◆ $helper

ilTermsOfServiceHelper ilTermsOfServiceAppEventListener::$helper
protected

Definition at line 27 of file class.ilTermsOfServiceAppEventListener.php.

Referenced by __construct().

◆ $parameters

array ilTermsOfServiceAppEventListener::$parameters = []
protected

Definition at line 30 of file class.ilTermsOfServiceAppEventListener.php.

Referenced by withParameters().


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