ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMailAddressTypeFactory Class Reference

Class ilMailAddressTypeFactory. More...

+ Collaboration diagram for ilMailAddressTypeFactory:

Static Public Member Functions

static getByPrefix (ilMailAddress $a_address)
 

Detailed Description

Member Function Documentation

◆ getByPrefix()

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

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

References ilMailAddress\getHost(), ilMailAddress\getMailbox(), ilUtil\groupNameExists(), and ilMail\ILIAS_HOST.

Referenced by ilMail\checkRecipients(), ilMail\getUserIds(), and ilMailAddressTypesTest\testFactoryShouldReturnShouldReturnProperAddressType().

15  {
16  switch(true)
17  {
18  case substr($a_address->getMailbox(), 0, 1) != '#' && substr($a_address->getMailbox(), 0, 2) != '"#':
19  require_once 'Services/Mail/classes/Address/Type/class.ilMailLoginOrEmailAddressAddressType.php';
20  return new ilMailLoginOrEmailAddressAddressType($a_address);
21  break;
22 
23  case substr($a_address->getMailbox(), 0, 7) == '#il_ml_':
24  require_once 'Services/Mail/classes/Address/Type/class.ilMailMailingListAddressType.php';
25  return new ilMailMailingListAddressType($a_address);
26  break;
27 
28  case (
29  ilUtil::groupNameExists(substr($a_address->getMailbox(), 1)) &&
30  (
31  $a_address->getHost() == ilMail::ILIAS_HOST ||
32  0 === strlen($a_address->getHost())
33  )
34  ):
35  require_once 'Services/Mail/classes/Address/Type/class.ilMailGroupAddressType.php';
36  return new ilMailGroupAddressType($a_address);
37  break;
38 
39  default:
40  require_once 'Services/Mail/classes/Address/Type/class.ilMailRoleAddressType.php';
41  return new ilMailRoleAddressType($a_address);
42  break;
43  }
44  }
const ILIAS_HOST
Class ilMailMailingListAddressType.
static groupNameExists($a_group_name, $a_id=0)
checks if group name already exists.
Class ilMailRoleAddressType.
Class ilMailGroupAddressType.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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