ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailMimeSenderFactory Class Reference

Class ilMailMimeSenderFactory. More...

+ Collaboration diagram for ilMailMimeSenderFactory:

Public Member Functions

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

Protected Member Functions

 isSystemMail (int $usrId)
 

Protected Attributes

array $senders = []
 
int $anonymousUsrId = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $anonymousUsrId, ANONYMOUS_USER_ID, and null.

35  {
36  if (null === $anonymousUsrId && defined('ANONYMOUS_USER_ID')) {
38  }
39  if (null === $anonymousUsrId) {
40  throw new Exception();
41  }
42 
43  $this->anonymousUsrId = $anonymousUsrId;
44  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Member Function Documentation

◆ getSenderByUsrId()

ilMailMimeSenderFactory::getSenderByUsrId ( int  $usrId)

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

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

52  {
53  if (array_key_exists($usrId, $this->senders)) {
54  return $this->senders[$usrId];
55  }
56 
57  if ($this->isSystemMail($usrId)) {
58  $sender = $this->system();
59  } else {
60  $sender = $this->user($usrId);
61  }
62 
63  $this->senders[$usrId] = $sender;
64 
65  return $sender;
66  }
Interface ilMailMimeTransport.
+ Here is the call graph for this function:

◆ isSystemMail()

ilMailMimeSenderFactory::isSystemMail ( int  $usrId)
protected

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

References $anonymousUsrId.

Referenced by getSenderByUsrId().

46  : bool
47  {
48  return $usrId === $this->anonymousUsrId;
49  }
+ Here is the caller graph for this function:

◆ system()

ilMailMimeSenderFactory::system ( )

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

References ILIAS\Repository\settings().

Referenced by getSenderByUsrId().

69  {
70  return new ilMailMimeSenderSystem($this->settings);
71  }
Class ilMailMimeSenderSystem.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user()

ilMailMimeSenderFactory::user ( int  $usrId)

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

References ILIAS\Repository\settings().

Referenced by getSenderByUsrId().

74  {
75  return new ilMailMimeSenderUserById($this->settings, $usrId, $this->mustache_factory);
76  }
Class ilMailMimeSenderSystem.
Class ilMailMimeSenderUserById.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userByEmailAddress()

ilMailMimeSenderFactory::userByEmailAddress ( string  $emailAddress)

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

References ILIAS\Repository\settings().

79  {
80  return new ilMailMimeSenderUserByEmailAddress($this->settings, $emailAddress, $this->mustache_factory);
81  }
Class ilMailMimeSenderSystem.
Class ilMailMimeSenderUserByEmailAddress.
+ Here is the call graph for this function:

Field Documentation

◆ $anonymousUsrId

int ilMailMimeSenderFactory::$anonymousUsrId = 0
protected

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

Referenced by __construct(), and isSystemMail().

◆ $senders

array ilMailMimeSenderFactory::$senders = []
protected

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


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