ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMailMimeSenderFactory Class Reference

Class ilMailMimeSenderFactory. More...

+ Collaboration diagram for ilMailMimeSenderFactory:

Public Member Functions

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

Protected Member Functions

 isSystemMail (int $usrId)
 

Protected Attributes

 $settings
 
 $senders = []
 
 $anonymousUsrId = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

ilMailMimeSenderFactory constructor.

Parameters
ilSetting$settings
int | null$anonymousUsrId

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

25 {
26 $this->settings = $settings;
27 if (null === $anonymousUsrId && defined('ANONYMOUS_USER_ID')) {
28 $anonymousUsrId = (int) ANONYMOUS_USER_ID;
29 }
30 $this->anonymousUsrId = $anonymousUsrId;
31 }
settings()
Definition: settings.php:2

References $anonymousUsrId, $settings, and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ getSenderByUsrId()

ilMailMimeSenderFactory::getSenderByUsrId ( int  $usrId)
Parameters
int$usrId
Returns
ilMailMimeSender

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

47 {
48 if (array_key_exists($usrId, $this->senders)) {
49 return $this->senders[$usrId];
50 }
51
52 switch (true) {
53 case $this->isSystemMail($usrId):
54 $sender = $this->system();
55 break;
56
57 default:
58 $sender = $this->user($usrId);
59 break;
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
Parameters
int$usrId
Returns
bool

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

37 : bool
38 {
39 return $usrId === $this->anonymousUsrId;
40 }

References $anonymousUsrId.

Referenced by getSenderByUsrId().

+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )
Returns
ilMailMimeSenderSystem

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

71 {
72 return new ilMailMimeSenderSystem($this->settings);
73 }
Class ilMailMimeSenderSystem.

References 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)
Parameters
int$usrId
Returns
ilMailMimeSenderUser

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

80 {
81 return new ilMailMimeSenderUserById($this->settings, $usrId);
82 }
Class ilMailMimeSenderUserById.
Class ilMailMimeSenderSystem.

References 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)
Parameters
string$emailAddress
Returns
ilMailMimeSenderUser

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

89 {
90 return new ilMailMimeSenderUserByEmailAddress($this->settings, $emailAddress);
91 }

References settings().

+ Here is the call graph for this function:

Field Documentation

◆ $anonymousUsrId

ilMailMimeSenderFactory::$anonymousUsrId = 0
protected

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

Referenced by __construct(), and isSystemMail().

◆ $senders

ilMailMimeSenderFactory::$senders = []
protected

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

◆ $settings

ilMailMimeSenderFactory::$settings
protected

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

Referenced by __construct().


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