ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMailAppEventListener Class Reference
+ Inheritance diagram for ilMailAppEventListener:
+ Collaboration diagram for ilMailAppEventListener:

Public Member Functions

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

Static Public Member Functions

static handleEvent ($a_component, $a_event, $a_parameter)
 @inheritDoc More...
 
- Static Public Member Functions inherited from ilAppEventListener
static handleEvent (string $a_component, string $a_event, array $a_parameter)
 Handle an event in a listener. More...
 

Protected Attributes

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

Private Member Functions

 isRelevantEvent ()
 

Private Attributes

readonly Container $dic
 

Detailed Description

Definition at line 24 of file class.ilMailAppEventListener.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailAppEventListener::__construct ( )

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

33 {
34 global $DIC;
35 $this->dic = $DIC;
36 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ handle()

ilMailAppEventListener::handle ( )

Definition at line 71 of file class.ilMailAppEventListener.php.

71 : void
72 {
73 if (isset($this->parameters[PropertyAttributes::VisibleToUser->value])
74 && $this->isRelevantEvent()
75 && !$this->parameters[PropertyAttributes::VisibleToUser->value]->getNewValue()) {
76 switch ((int) ($this->dic->settings()->get('mail_address_option') ?? ilMailOptions::FIRST_EMAIL)) {
80 $this->dic->database(),
82 );
83 $command->execute();
84 break;
85 }
86 }
87 }
final const int FIRST_EMAIL
final const int BOTH_EMAIL
final const int SECOND_EMAIL

References ilMailOptions\BOTH_EMAIL, ilMailOptions\FIRST_EMAIL, isRelevantEvent(), ILIAS\UI\examples\Prompt\Standard\parameters(), and ilMailOptions\SECOND_EMAIL.

+ Here is the call graph for this function:

◆ handleEvent()

static ilMailAppEventListener::handleEvent (   $a_component,
  $a_event,
  $a_parameter 
)
static

@inheritDoc

Definition at line 92 of file class.ilMailAppEventListener.php.

92 : void
93 {
94 $listener = new self();
95 $listener
96 ->withComponent($a_component)
97 ->withEvent($a_event)
98 ->withParameters($a_parameter)
99 ->handle();
100 }

◆ isRelevantEvent()

ilMailAppEventListener::isRelevantEvent ( )
private

Definition at line 65 of file class.ilMailAppEventListener.php.

65 : bool
66 {
67 return $this->component === 'components/ILIAS/User'
68 && $this->event === 'onUserFieldAttributesChanged';
69 }

Referenced by handle().

+ Here is the caller graph for this function:

◆ withComponent()

ilMailAppEventListener::withComponent ( string  $component)

Definition at line 38 of file class.ilMailAppEventListener.php.

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

References $component.

◆ withEvent()

ilMailAppEventListener::withEvent ( string  $event)

Definition at line 47 of file class.ilMailAppEventListener.php.

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

References $event.

◆ withParameters()

ilMailAppEventListener::withParameters ( array  $parameters)

Definition at line 56 of file class.ilMailAppEventListener.php.

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

References $parameters.

Field Documentation

◆ $component

string ilMailAppEventListener::$component = ''
protected

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

Referenced by withComponent().

◆ $dic

readonly Container ilMailAppEventListener::$dic
private

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

◆ $event

string ilMailAppEventListener::$event = ''
protected

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

Referenced by withEvent().

◆ $parameters

array ilMailAppEventListener::$parameters = []
protected

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

Referenced by withParameters().


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