ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMailOnlyExternalAddressList Class Reference

Class ilMailOnlyExternalAddressList. More...

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

Public Member Functions

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

Protected Attributes

ilMailAddressList $origin
 
string $installationHost
 
 $getUsrIdByLoginCallable
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $getUsrIdByLoginCallable, $installationHost, and $origin.

40  {
41  $this->origin = $origin;
42  $this->installationHost = $installationHost;
43  $this->getUsrIdByLoginCallable = $getUsrIdByLoginCallable;
44  }

Member Function Documentation

◆ value()

ilMailOnlyExternalAddressList::value ( )
Returns
ilMailAddress[]

Implements ilMailAddressList.

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

References $c, $getUsrIdByLoginCallable, and $installationHost.

46  : array
47  {
48  $addresses = $this->origin->value();
49 
50  $filteredAddresses = array_filter($addresses, function (ilMailAddress $address): bool {
52  if ($c((string) $address)) {
53  // Fixed mantis bug #5875
54  return false;
55  }
56 
57  if ($address->getHost() === $this->installationHost) {
58  return false;
59  }
60 
61  if (strpos($address->getMailbox(), '#') === 0) {
62  return false;
63  }
64 
65  return true;
66  });
67 
68  return $filteredAddresses;
69  }
$c
Definition: cli.php:38
Class ilMailAddress.

Field Documentation

◆ $getUsrIdByLoginCallable

ilMailOnlyExternalAddressList::$getUsrIdByLoginCallable
protected

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

Referenced by __construct(), and value().

◆ $installationHost

string ilMailOnlyExternalAddressList::$installationHost
protected

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

Referenced by __construct(), and value().

◆ $origin

ilMailAddressList ilMailOnlyExternalAddressList::$origin
protected

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

Referenced by __construct().


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