ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 ilMailOnlyExternalAddressList constructor. More...
 
 value ()
 
Returns
ilMailAddress[]
More...
 

Protected Attributes

 $origin
 
 $installationHost
 
 $getUsrIdByLoginCallable
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailOnlyExternalAddressList::__construct ( ilMailAddressList  $origin,
string  $installationHost,
callable  $getUsrIdByLoginCallable 
)

ilMailOnlyExternalAddressList constructor.

Parameters
ilMailAddressList$origin
string$installationHost
callable$getUsrIdByLoginCallableA callable which accepts a string as argument and returns an integer >= 0

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

References $getUsrIdByLoginCallable, $installationHost, and $origin.

Member Function Documentation

◆ value()

ilMailOnlyExternalAddressList::value ( )

Returns
ilMailAddress[]

Implements ilMailAddressList.

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

References $c, $getUsrIdByLoginCallable, and $installationHost.

38  : array
39  {
40  $addresses = $this->origin->value();
41 
42  $filteredAddresses = array_filter($addresses, function (ilMailAddress $address) {
44  if ($c((string) $address)) {
45  // Fixed mantis bug #5875
46  return false;
47  }
48 
49  if ($address->getHost() === $this->installationHost) {
50  return false;
51  }
52 
53  if ('#' === substr($address->getMailbox(), 0, 1)) {
54  return false;
55  }
56 
57  return true;
58  });
59 
60  return $filteredAddresses;
61  }
$c
Definition: cli.php:37
Class ilMailAddress.

Field Documentation

◆ $getUsrIdByLoginCallable

ilMailOnlyExternalAddressList::$getUsrIdByLoginCallable
protected

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

Referenced by __construct(), and value().

◆ $installationHost

ilMailOnlyExternalAddressList::$installationHost
protected

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

Referenced by __construct(), and value().

◆ $origin

ilMailOnlyExternalAddressList::$origin
protected

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

Referenced by __construct().


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