ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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

 $rbacsystem
 
 $rbacreview
 
 $typeHelper
 
 $lists
 
 $roleMailboxSearch
 

Private Attributes

 $groupNameValidator
 
 $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 
)
Parameters
\ilGroupNameAsMailValidator | null$groupNameValidator
\ilLogger | null$logger
\ilRbacSystem | null$rbacsystem
\ilRbacReview | null$rbacreview
\ilMailAddressTypeHelper | null$typeHelper
\ilMailingLists | null$lists
\ilRoleMailboxSearch | null$roleMailboxSearch

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

48 {
49 global $DIC;
50
51 if ($groupNameValidator === null) {
52 $groupNameValidator = new \ilGroupNameAsMailValidator(\ilMail::ILIAS_HOST);
53 }
54
55 if ($logger === null) {
57 }
58
59 if ($typeHelper === null) {
60 $typeHelper = new \ilMailAddressTypeHelperImpl(\ilMail::ILIAS_HOST);
61 }
62
63 if ($rbacsystem === null) {
64 $rbacsystem = $DIC->rbac()->system();
65 }
66
67 if ($rbacreview === null) {
68 $rbacreview = $DIC->rbac()->review();
69 }
70
71 if ($lists === null) {
72 $lists = new \ilMailingLists($DIC->user());
73 }
74
75 if ($roleMailboxSearch === null) {
76 $roleMailboxSearch = new \ilRoleMailboxSearch(new \ilMailRfc822AddressParserFactory(), $DIC->database());
77 }
78
79 $this->groupNameValidator = $groupNameValidator;
80 $this->logger = $logger;
81 $this->typeHelper = $typeHelper;
82 $this->rbacsystem = $rbacsystem;
83 $this->rbacreview = $rbacreview;
84 $this->lists = $lists;
85 $this->roleMailboxSearch = $roleMailboxSearch;
86 }
static getLogger($a_component_id)
Get component logger.
Class ilMailRfc822AddressParserFactory.
const ILIAS_HOST
global $DIC
Definition: saml.php:7

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getByPrefix()

ilMailAddressTypeFactory::getByPrefix ( \ilMailAddress  $address,
bool  $cached = true 
)
Parameters
\ilMailAddress$address
bool$cached
Returns
\ilMailAddressType

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

94 {
95 switch (true) {
96 case substr($address->getMailbox(), 0, 1) !== '#' && substr($address->getMailbox(), 0, 2) !== '"#':
97 $addressType = new \ilMailLoginOrEmailAddressAddressType(
98 $this->typeHelper,
99 $address,
100 $this->logger,
101 $this->rbacsystem
102 );
103 break;
104
105 case substr($address->getMailbox(), 0, 7) === '#il_ml_':
106 $addressType = new \ilMailMailingListAddressType(
107 $this->typeHelper,
108 $address,
109 $this->logger,
110 $this->lists
111 );
112 break;
113
114 case ($this->groupNameValidator->validate($address)):
115 $addressType = new \ilMailGroupAddressType(
116 $this->typeHelper,
117 $address,
118 $this->logger
119 );
120 break;
121
122 default:
123 $addressType = new \ilMailRoleAddressType(
124 $this->typeHelper,
125 $address,
126 $this->roleMailboxSearch,
127 $this->logger,
128 $this->rbacsystem,
129 $this->rbacreview
130 );
131 break;
132 }
133
134 return new \ilMailCachedAddressType($addressType, $cached);
135 }
Interface ilMailAddressType.

References ilMailAddress\getMailbox().

+ Here is the call graph for this function:

Field Documentation

◆ $groupNameValidator

ilMailAddressTypeFactory::$groupNameValidator
private

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

Referenced by __construct().

◆ $lists

ilMailAddressTypeFactory::$lists
protected

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

Referenced by __construct().

◆ $logger

ilMailAddressTypeFactory::$logger
private

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

Referenced by __construct().

◆ $rbacreview

ilMailAddressTypeFactory::$rbacreview
protected

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

Referenced by __construct().

◆ $rbacsystem

ilMailAddressTypeFactory::$rbacsystem
protected

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

Referenced by __construct().

◆ $roleMailboxSearch

ilMailAddressTypeFactory::$roleMailboxSearch
protected

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

Referenced by __construct().

◆ $typeHelper

ilMailAddressTypeFactory::$typeHelper
protected

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

Referenced by __construct().


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