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

Public Member Functions

 __construct (protected ilSetting $settings, protected ilMustacheFactory $mustache_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 21 of file class.ilMailMimeSenderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailMimeSenderFactory::__construct ( protected ilSetting  $settings,
protected ilMustacheFactory  $mustache_factory,
?int  $anonymous_usr_id = null 
)

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

31 {
32 if ($anonymous_usr_id === null && defined('ANONYMOUS_USER_ID')) {
34 }
35 if ($anonymous_usr_id === null) {
36 throw new Exception();
37 }
38
39 $this->anonymous_usr_id = $anonymous_usr_id;
40 }
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 47 of file class.ilMailMimeSenderFactory.php.

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

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

+ Here is the call graph for this function:

◆ isSystemMail()

ilMailMimeSenderFactory::isSystemMail ( int  $usr_id)
protected

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

42 : bool
43 {
44 return $usr_id === $this->anonymous_usr_id;
45 }

References $anonymous_usr_id.

Referenced by getSenderByUsrId().

+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )

Definition at line 64 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 69 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 74 of file class.ilMailMimeSenderFactory.php.

75 {
76 return new ilMailMimeSenderUserByEmailAddress($this->settings, $email_address, $this->mustache_factory);
77 }

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 25 of file class.ilMailMimeSenderFactory.php.

Referenced by __construct(), and isSystemMail().

◆ $senders

array ilMailMimeSenderFactory::$senders = []
protected

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


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