ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailAddressTypeFactory Class Reference

Class ilMailAddressTypeFactory. More...

+ Collaboration diagram for ilMailAddressTypeFactory:

Public Member Functions

 __construct (?ilGroupNameAsMailValidator $groupNameValidator=null, ?ilLogger $logger=null, ?ilRbacSystem $rbacsystem=null, ?ilRbacReview $rbacreview=null, ?ilMailAddressTypeHelper $typeHelper=null, ?ilMailingLists $lists=null, ?ilRoleMailboxSearch $roleMailboxSearch=null)
 
 getByPrefix (ilMailAddress $address, bool $cached=true)
 

Protected Attributes

ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilMailAddressTypeHelper $typeHelper
 
ilMailingLists $lists
 
ilRoleMailboxSearch $roleMailboxSearch
 

Private Attributes

readonly ilGroupNameAsMailValidator $groupNameValidator
 
readonly ilLogger $logger
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailAddressTypeFactory::__construct ( ?ilGroupNameAsMailValidator  $groupNameValidator = null,
?ilLogger  $logger = null,
?ilRbacSystem  $rbacsystem = null,
?ilRbacReview  $rbacreview = null,
?ilMailAddressTypeHelper  $typeHelper = null,
?ilMailingLists  $lists = null,
?ilRoleMailboxSearch  $roleMailboxSearch = null 
)

Definition at line 35 of file class.ilMailAddressTypeFactory.php.

References $DIC, $groupNameValidator, $lists, $logger, $rbacreview, $rbacsystem, $roleMailboxSearch, $typeHelper, ilLoggerFactory\getLogger(), ilMail\ILIAS_HOST, ILIAS\Repository\logger(), and null.

43  {
44  global $DIC;
45 
46  if ($groupNameValidator === null) {
48  }
49 
50  if ($logger === null) {
52  }
53 
54  if ($typeHelper === null) {
56  }
57 
58  if ($rbacsystem === null) {
59  $rbacsystem = $DIC->rbac()->system();
60  }
61 
62  if ($rbacreview === null) {
63  $rbacreview = $DIC->rbac()->review();
64  }
65 
66  if ($lists === null) {
67  $lists = new ilMailingLists($DIC->user());
68  }
69 
70  if ($roleMailboxSearch === null) {
72  }
73 
74  $this->groupNameValidator = $groupNameValidator;
75  $this->logger = $logger;
76  $this->typeHelper = $typeHelper;
77  $this->rbacsystem = $rbacsystem;
78  $this->rbacreview = $rbacreview;
79  $this->lists = $lists;
80  $this->roleMailboxSearch = $roleMailboxSearch;
81  }
readonly ilGroupNameAsMailValidator $groupNameValidator
static getLogger(string $a_component_id)
Get component logger.
const ILIAS_HOST
Class ilGroupNameAsMailValidator.
Class ilRoleMailboxSearch.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilMailRfc822AddressParserFactory.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getByPrefix()

ilMailAddressTypeFactory::getByPrefix ( ilMailAddress  $address,
bool  $cached = true 
)

Definition at line 83 of file class.ilMailAddressTypeFactory.php.

References ilMailAddress\getMailbox(), ILIAS\Repository\logger(), and ilBaseMailAddressType\validate().

84  {
85  $addressType = match (true) {
86  str_starts_with($address->getMailbox(), '#il_ml_') => new ilMailMailingListAddressType(
87  $this->typeHelper,
88  $address,
89  $this->logger,
90  $this->lists
91  ),
92  !str_starts_with($address->getMailbox(), '#') && !str_starts_with(
93  $address->getMailbox(),
94  '"#'
96  $this->typeHelper,
97  $address,
98  $this->logger,
99  $this->rbacsystem
100  ),
101  $this->groupNameValidator->validate($address) => new ilMailGroupAddressType(
102  $this->typeHelper,
103  $address,
104  $this->logger
105  ),
106  default => new ilMailRoleAddressType(
107  $this->typeHelper,
108  $address,
109  $this->roleMailboxSearch,
110  $this->logger,
111  $this->rbacsystem,
112  $this->rbacreview
113  ),
114  };
115 
116  return new ilMailCachedAddressType($addressType, $cached);
117  }
validate(int $senderId)
Validates the parsed recipients and set errors accordingly.
Class ilMailMailingListAddressType.
Interface ilMailAddressType.
Class ilMailCachedAddressType.
Class ilMailRoleAddressType.
Class ilMailGroupAddressType.
+ Here is the call graph for this function:

Field Documentation

◆ $groupNameValidator

readonly ilGroupNameAsMailValidator ilMailAddressTypeFactory::$groupNameValidator
private

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

Referenced by __construct().

◆ $lists

ilMailingLists ilMailAddressTypeFactory::$lists
protected

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

Referenced by __construct().

◆ $logger

readonly ilLogger ilMailAddressTypeFactory::$logger
private

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

Referenced by __construct().

◆ $rbacreview

ilRbacReview ilMailAddressTypeFactory::$rbacreview
protected

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

Referenced by __construct().

◆ $rbacsystem

ilRbacSystem ilMailAddressTypeFactory::$rbacsystem
protected

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

Referenced by __construct().

◆ $roleMailboxSearch

ilRoleMailboxSearch ilMailAddressTypeFactory::$roleMailboxSearch
protected

Definition at line 33 of file class.ilMailAddressTypeFactory.php.

Referenced by __construct().

◆ $typeHelper

ilMailAddressTypeHelper ilMailAddressTypeFactory::$typeHelper
protected

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

Referenced by __construct().


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