ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailMimeSenderFactory Class Reference

Class ilMailMimeSenderFactory. More...

+ Collaboration diagram for ilMailMimeSenderFactory:

Public Member Functions

 __construct (\ilSetting $settings)
 ilMailMimeSenderFactory constructor. More...
 
 getSenderByUsrId ($usrId)
 
 system ()
 
 user ($usrId)
 
 userByEmailAddress ($emailAddress)
 

Protected Member Functions

 isSystemMail ($usrId)
 

Protected Attributes

 $settings
 
 $senders = array()
 

Detailed Description

Class ilMailMimeSenderFactory.

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

Constructor & Destructor Documentation

◆ __construct()

ilMailMimeSenderFactory::__construct ( \ilSetting  $settings)

ilMailMimeSenderFactory constructor.

Parameters
ilSetting$settings

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

References $settings, and settings().

24  {
25  $this->settings = $settings;
26  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ getSenderByUsrId()

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

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

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

42  {
43  if (array_key_exists($usrId, $this->senders)) {
44  return $this->senders[$usrId];
45  }
46 
47  switch (true) {
48  case $this->isSystemMail($usrId):
49  $sender = $this->system();
50  break;
51 
52  default:
53  $sender = $this->user($usrId);
54  break;
55  }
56 
57  $this->senders[$usrId] = $sender;
58 
59  return $sender;
60  }
+ Here is the call graph for this function:

◆ isSystemMail()

ilMailMimeSenderFactory::isSystemMail (   $usrId)
protected
Parameters
int$usrId
Returns
bool

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

Referenced by getSenderByUsrId().

33  {
34  return $usrId == ANONYMOUS_USER_ID;
35  }
+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )
Returns
ilMailMimeSenderSystem

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

References settings().

Referenced by getSenderByUsrId().

66  {
67  require_once 'Services/Mail/classes/Mime/Sender/class.ilMailMimeSenderSystem.php';
68  return new ilMailMimeSenderSystem($this->settings);
69  }
Class ilMailMimeSenderSystem.
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user()

ilMailMimeSenderFactory::user (   $usrId)
Parameters
int$usrId
Returns
ilMailMimeSenderUser

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

References ilMailMimeSenderUser\byUsrId(), and settings().

Referenced by getSenderByUsrId().

76  {
77  require_once 'Services/Mail/classes/Mime/Sender/class.ilMailMimeSenderUser.php';
78  return ilMailMimeSenderUser::byUsrId($this->settings, $usrId);
79  }
static byUsrId(\ilSetting $settings, $usrId)
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userByEmailAddress()

ilMailMimeSenderFactory::userByEmailAddress (   $emailAddress)
Parameters
$emailAddress
Returns
ilMailMimeSenderUser

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

References ilMailMimeSenderUser\byEmailAddress(), and settings().

86  {
87  require_once 'Services/Mail/classes/Mime/Sender/class.ilMailMimeSenderUser.php';
88  return ilMailMimeSenderUser::byEmailAddress($this->settings, $emailAddress);
89  }
static byEmailAddress(\ilSetting $settings, $emailAddress)
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Field Documentation

◆ $senders

ilMailMimeSenderFactory::$senders = array()
protected

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

◆ $settings

ilMailMimeSenderFactory::$settings
protected

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

Referenced by __construct().


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