ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilMailMimeSenderFactory Class Reference
+ Collaboration diagram for ilMailMimeSenderFactory:

Public Member Functions

 __construct (protected ilSetting $settings, protected TemplateEngineFactoryInterface $template_engine_factory, ?int $anonymous_usr_id=null)
 
 getSenderByUsrId (int $usr_id)
 
 system ()
 
 user (int $usr_id)
 
 userByEmailAddress (string $email_address)
 

Protected Member Functions

 isSystemMail (int $usr_id)
 

Protected Attributes

array $senders = []
 
int $anonymous_usr_id = 0
 

Detailed Description

Definition at line 23 of file class.ilMailMimeSenderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailMimeSenderFactory::__construct ( protected ilSetting  $settings,
protected TemplateEngineFactoryInterface  $template_engine_factory,
?int  $anonymous_usr_id = null 
)

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

33 {
34 if ($anonymous_usr_id === null && defined('ANONYMOUS_USER_ID')) {
36 }
37 if ($anonymous_usr_id === null) {
38 throw new Exception();
39 }
40
41 $this->anonymous_usr_id = $anonymous_usr_id;
42 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References $anonymous_usr_id, and ANONYMOUS_USER_ID.

Member Function Documentation

◆ getSenderByUsrId()

ilMailMimeSenderFactory::getSenderByUsrId ( int  $usr_id)

Definition at line 49 of file class.ilMailMimeSenderFactory.php.

50 {
51 if (array_key_exists($usr_id, $this->senders)) {
52 return $this->senders[$usr_id];
53 }
54
55 if ($this->isSystemMail($usr_id)) {
56 $sender = $this->system();
57 } else {
58 $sender = $this->user($usr_id);
59 }
60
61 $this->senders[$usr_id] = $sender;
62
63 return $sender;
64 }

References isSystemMail(), system(), and user().

+ Here is the call graph for this function:

◆ isSystemMail()

ilMailMimeSenderFactory::isSystemMail ( int  $usr_id)
protected

Definition at line 44 of file class.ilMailMimeSenderFactory.php.

44 : bool
45 {
46 return $usr_id === $this->anonymous_usr_id;
47 }

References $anonymous_usr_id.

Referenced by getSenderByUsrId().

+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )

Definition at line 66 of file class.ilMailMimeSenderFactory.php.

References ILIAS\Repository\settings().

Referenced by getSenderByUsrId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user()

ilMailMimeSenderFactory::user ( int  $usr_id)

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

References ILIAS\Repository\settings().

Referenced by getSenderByUsrId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userByEmailAddress()

ilMailMimeSenderFactory::userByEmailAddress ( string  $email_address)

Definition at line 76 of file class.ilMailMimeSenderFactory.php.

77 {
78 return new ilMailMimeSenderUserByEmailAddress($this->settings, $email_address, $this->template_engine_factory);
79 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ $anonymous_usr_id

int ilMailMimeSenderFactory::$anonymous_usr_id = 0
protected

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

Referenced by __construct(), and isSystemMail().

◆ $senders

array ilMailMimeSenderFactory::$senders = []
protected

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


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