ILIAS  release_8 Revision v8.24
ilMailMimeSenderFactory Class Reference

Class ilMailMimeSenderFactory. More...

+ Collaboration diagram for ilMailMimeSenderFactory:

Public Member Functions

 __construct (ilSetting $settings, int $anonymousUsrId=null)
 
 getSenderByUsrId (int $usrId)
 
 system ()
 
 user (int $usrId)
 
 userByEmailAddress (string $emailAddress)
 

Protected Member Functions

 isSystemMail (int $usrId)
 

Protected Attributes

ilSetting $settings
 
array $senders = []
 
int $anonymousUsrId = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailMimeSenderFactory::__construct ( ilSetting  $settings,
int  $anonymousUsrId = null 
)

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

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

References $anonymousUsrId, $settings, ANONYMOUS_USER_ID, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getSenderByUsrId()

ilMailMimeSenderFactory::getSenderByUsrId ( int  $usrId)

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

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

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

+ Here is the call graph for this function:

◆ isSystemMail()

ilMailMimeSenderFactory::isSystemMail ( int  $usrId)
protected

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

45 : bool
46 {
47 return $usrId === $this->anonymousUsrId;
48 }

References $anonymousUsrId.

Referenced by getSenderByUsrId().

+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )

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

68 {
69 return new ilMailMimeSenderSystem($this->settings);
70 }
Class ilMailMimeSenderSystem.

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  $usrId)

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

73 {
74 return new ilMailMimeSenderUserById($this->settings, $usrId);
75 }
Class ilMailMimeSenderUserById.
Class ilMailMimeSenderSystem.

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  $emailAddress)

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

78 {
79 return new ilMailMimeSenderUserByEmailAddress($this->settings, $emailAddress);
80 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ $anonymousUsrId

int ilMailMimeSenderFactory::$anonymousUsrId = 0
protected

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

Referenced by __construct(), and isSystemMail().

◆ $senders

array ilMailMimeSenderFactory::$senders = []
protected

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

◆ $settings

ilSetting ilMailMimeSenderFactory::$settings
protected

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

Referenced by __construct().


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