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

Class ilMailAddressTypeFactory. More...

+ Collaboration diagram for ilMailAddressTypeFactory:

Public Member Functions

 __construct (ilGroupNameAsMailValidator $groupNameValidator=null)
 
 getByPrefix (ilMailAddress $a_address)
 

Private Attributes

 $groupNameValidator
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailAddressTypeFactory::__construct ( ilGroupNameAsMailValidator  $groupNameValidator = null)
Parameters
ilGroupNameAsMailValidator | null$groupNameValidator

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

References $groupNameValidator, and ilMail\ILIAS_HOST.

17  {
18  if ($groupNameValidator === null) {
19  $groupNameValidator = new ilGroupNameAsMailValidator(ilMail::ILIAS_HOST);
20  }
21  $this->groupNameValidator = $groupNameValidator;
22  }
const ILIAS_HOST

Member Function Documentation

◆ getByPrefix()

ilMailAddressTypeFactory::getByPrefix ( ilMailAddress  $a_address)
Parameters
ilMailAddress$a_address
Returns
ilMailAddressType

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

References ilMailAddress\getMailbox().

29  {
30  switch (true) {
31  case substr($a_address->getMailbox(), 0, 1) != '#' && substr($a_address->getMailbox(), 0, 2) != '"#':
32  require_once 'Services/Mail/classes/Address/Type/class.ilMailLoginOrEmailAddressAddressType.php';
33  return new ilMailLoginOrEmailAddressAddressType($a_address);
34 
35  case substr($a_address->getMailbox(), 0, 7) == '#il_ml_':
36  require_once 'Services/Mail/classes/Address/Type/class.ilMailMailingListAddressType.php';
37  return new ilMailMailingListAddressType($a_address);
38 
39  case ($this->groupNameValidator->validate($a_address)):
40  require_once 'Services/Mail/classes/Address/Type/class.ilMailGroupAddressType.php';
41  return new ilMailGroupAddressType($a_address);
42 
43  default:
44  require_once 'Services/Mail/classes/Address/Type/class.ilMailRoleAddressType.php';
45  return new ilMailRoleAddressType($a_address);
46  }
47  }
Class ilMailMailingListAddressType.
Class ilMailRoleAddressType.
Class ilMailGroupAddressType.
+ 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().


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