ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceAppEventListener Class Reference

Class ilTermsOfServiceAppEventListener. More...

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

Public Member Functions

 __construct (\ilTermsOfServiceHelper $helper)
 ilTermsOfServiceAppEventListener constructor. More...
 
 withComponent (string $component)
 
 withEvent (string $event)
 
 withParameters (array $parameters)
 
 handle ()
 

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_parameter)
 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" => ...)
More...
 

Protected Member Functions

 isUserDeletionEvent ()
 

Protected Attributes

 $helper
 
 $component = ''
 
 $event = ''
 
 $parameters = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceAppEventListener::__construct ( \ilTermsOfServiceHelper  $helper)

ilTermsOfServiceAppEventListener constructor.

Parameters
\ilTermsOfServiceHelper$helper

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

References $helper.

Member Function Documentation

◆ handle()

ilTermsOfServiceAppEventListener::handle ( )
Exceptions

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

References isUserDeletionEvent().

85  {
86  if ($this->isUserDeletionEvent()) {
87  $this->helper->deleteAcceptanceHistoryByUser($this->parameters['usr_id']);
88  }
89  }
+ Here is the call graph for this function:

◆ handleEvent()

static ilTermsOfServiceAppEventListener::handleEvent (   $a_component,
  $a_event,
  $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 94 of file class.ilTermsOfServiceAppEventListener.php.

Referenced by ilTermsOfServiceAppEventListenerTest\testStaticEventListeningWorksAsExpected().

95  {
96  $listener = new static(new \ilTermsOfServiceHelper());
97  $listener
98  ->withComponent($a_component)
99  ->withEvent($a_event)
100  ->withParameters($a_parameter)
101  ->handle();
102  }
+ Here is the caller graph for this function:

◆ isUserDeletionEvent()

ilTermsOfServiceAppEventListener::isUserDeletionEvent ( )
protected
Returns
bool

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

Referenced by handle().

73  : bool
74  {
75  return (
76  'Services/User' === $this->component &&
77  'deleteUser' === $this->event
78  );
79  }
+ Here is the caller graph for this function:

◆ withComponent()

ilTermsOfServiceAppEventListener::withComponent ( string  $component)
Parameters
string$component
Returns

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

References $component.

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

◆ withEvent()

ilTermsOfServiceAppEventListener::withEvent ( string  $event)
Parameters
string$event
Returns

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

References $event.

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

◆ withParameters()

ilTermsOfServiceAppEventListener::withParameters ( array  $parameters)
Parameters
array$parameters
Returns

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

References $parameters.

61  : self
62  {
63  $clone = clone $this;
64 
65  $clone->parameters = $parameters;
66 
67  return $clone;
68  }

Field Documentation

◆ $component

ilTermsOfServiceAppEventListener::$component = ''
protected

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

Referenced by withComponent().

◆ $event

ilTermsOfServiceAppEventListener::$event = ''
protected

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

Referenced by withEvent().

◆ $helper

ilTermsOfServiceAppEventListener::$helper
protected

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

Referenced by __construct().

◆ $parameters

ilTermsOfServiceAppEventListener::$parameters = []
protected

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

Referenced by withParameters().


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