ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
static handleEvent ($a_component, $a_event, $a_parameter)
 Handle an event in a listener. More...
 

Protected Member Functions

 isUserDeletionEvent ()
 

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceAppEventListener::__construct ( ilTermsOfServiceHelper  $helper)

Member Function Documentation

◆ handle()

ilTermsOfServiceAppEventListener::handle ( )
Exceptions
ilTermsOfServiceMissingDatabaseAdapterException

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

84 : void
85 {
86 if ($this->isUserDeletionEvent()) {
87 $this->helper->deleteAcceptanceHistoryByUser($this->parameters['usr_id']);
88 }
89 }

References isUserDeletionEvent().

+ 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.

Reimplemented in ilTestableTermsOfServiceAppEventListener.

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

94 : void
95 {
96 $listener = new static(new ilTermsOfServiceHelper());
97 $listener
98 ->withComponent($a_component)
99 ->withEvent($a_event)
100 ->withParameters($a_parameter)
101 ->handle();
102 }
Class ilTermsOfServiceHelper.

◆ isUserDeletionEvent()

ilTermsOfServiceAppEventListener::isUserDeletionEvent ( )
protected
Returns
bool

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

73 : bool
74 {
75 return (
76 'Services/User' === $this->component &&
77 'deleteUser' === $this->event
78 );
79 }

Referenced by handle().

+ Here is the caller graph for this function:

◆ withComponent()

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

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

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

References $component.

◆ withEvent()

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

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

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

References $event.

◆ withParameters()

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

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

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

References $parameters.

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

ilTermsOfServiceHelper ilTermsOfServiceAppEventListener::$helper
protected

◆ $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: