ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailOnlyExternalAddressList Class Reference

Class ilMailOnlyExternalAddressList. More...

+ Inheritance diagram for ilMailOnlyExternalAddressList:
+ Collaboration diagram for ilMailOnlyExternalAddressList:

Public Member Functions

 __construct (protected ilMailAddressList $origin, protected string $installationHost, callable $getUsrIdByLoginCallable)
 
 value ()
 

Protected Attributes

 $getUsrIdByLoginCallable
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailOnlyExternalAddressList::__construct ( protected ilMailAddressList  $origin,
protected string  $installationHost,
callable  $getUsrIdByLoginCallable 
)
Parameters
callable$getUsrIdByLoginCallableA callable which accepts a string as argument and returns an integer >= 0

Definition at line 34 of file class.ilMailOnlyExternalAddressList.php.

References $getUsrIdByLoginCallable.

38  {
39  $this->getUsrIdByLoginCallable = $getUsrIdByLoginCallable;
40  }

Member Function Documentation

◆ value()

ilMailOnlyExternalAddressList::value ( )
Returns
ilMailAddress[]

Implements ilMailAddressList.

Definition at line 42 of file class.ilMailOnlyExternalAddressList.php.

42  : array
43  {
44  $addresses = $this->origin->value();
45 
46  return array_filter($addresses, function (ilMailAddress $address): bool {
47  if (($this->getUsrIdByLoginCallable)((string) $address)) {
48  // Fixed mantis bug #5875
49  return false;
50  }
51 
52  if ($address->getHost() === $this->installationHost) {
53  return false;
54  }
55 
56  return !str_starts_with($address->getMailbox(), '#');
57  });
58  }
Class ilMailAddress.

Field Documentation

◆ $getUsrIdByLoginCallable

ilMailOnlyExternalAddressList::$getUsrIdByLoginCallable
protected

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

Referenced by __construct().


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