ILIAS  release_8 Revision v8.23
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

ilGroupNameAsMailValidator $groupNameValidator
 
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, and ILIAS\Repository\logger().

43  {
44  global $DIC;
45 
46  if ($groupNameValidator === null) {
47  $groupNameValidator = new ilGroupNameAsMailValidator(ilMail::ILIAS_HOST);
48  }
49 
50  if ($logger === null) {
51  $logger = ilLoggerFactory::getLogger('mail');
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) {
71  $roleMailboxSearch = new ilRoleMailboxSearch(new ilMailRfc822AddressParserFactory(), $DIC->database());
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  }
ilGroupNameAsMailValidator $groupNameValidator
static getLogger(string $a_component_id)
Get component logger.
const ILIAS_HOST
Class ilGroupNameAsMailValidator.
Class ilRoleMailboxSearch.
global $DIC
Definition: feed.php:28
Class ilMailRfc822AddressParserFactory.
Class ilMailAddressTypeHelper.
+ 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(), and ILIAS\Repository\logger().

84  {
85  switch (true) {
86  case strpos($address->getMailbox(), '#') !== 0 && strpos($address->getMailbox(), '"#') !== 0:
87  $addressType = new ilMailLoginOrEmailAddressAddressType(
88  $this->typeHelper,
89  $address,
90  $this->logger,
91  $this->rbacsystem
92  );
93  break;
94 
95  case strpos($address->getMailbox(), '#il_ml_') === 0:
96  $addressType = new ilMailMailingListAddressType(
97  $this->typeHelper,
98  $address,
99  $this->logger,
100  $this->lists
101  );
102  break;
103 
104  case ($this->groupNameValidator->validate($address)):
105  $addressType = new ilMailGroupAddressType(
106  $this->typeHelper,
107  $address,
108  $this->logger
109  );
110  break;
111 
112  default:
113  $addressType = new ilMailRoleAddressType(
114  $this->typeHelper,
115  $address,
116  $this->roleMailboxSearch,
117  $this->logger,
118  $this->rbacsystem,
119  $this->rbacreview
120  );
121  break;
122  }
123 
124  return new ilMailCachedAddressType($addressType, $cached);
125  }
Class ilMailMailingListAddressType.
Interface ilMailAddressType.
Class ilMailCachedAddressType.
Class ilMailRoleAddressType.
Class ilMailGroupAddressType.
+ Here is the call graph for this function:

Field Documentation

◆ $groupNameValidator

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

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: