ILIAS  release_8 Revision v8.24
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 ()
 
 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.

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

References $getUsrIdByLoginCallable, $installationHost, and $origin.

Member Function Documentation

◆ value()

ilMailOnlyExternalAddressList::value ( )
Returns
ilMailAddress[]

Implements ilMailAddressList.

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

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 }
Class ilMailAddress.
$c
Definition: cli.php:38
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20

References $c, $getUsrIdByLoginCallable, and if.

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().

◆ $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: