ILIAS  release_8 Revision v8.24
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...
 
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.

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

References $helper.

Member Function Documentation

◆ handle()

ilTermsOfServiceAppEventListener::handle ( )

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

72 : void
73 {
74 if ($this->isUserDeletionEvent()) {
75 $this->helper->deleteAcceptanceHistoryByUser($this->parameters['usr_id']);
76 }
77 }

References isUserDeletionEvent().

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

Reimplemented in ilTestableTermsOfServiceAppEventListener.

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.

64 : bool
65 {
66 return (
67 'Services/User' === $this->component &&
68 'deleteUser' === $this->event
69 );
70 }

References ILIAS\Repository\event().

Referenced by handle().

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

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

References $component.

◆ withEvent()

ilTermsOfServiceAppEventListener::withEvent ( string  $event)

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

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

References $event.

◆ withParameters()

ilTermsOfServiceAppEventListener::withParameters ( array  $parameters)

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

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

References $parameters.

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: