ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilMailOnlyExternalAddressList.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
29 
34  public function __construct(
35  protected ilMailAddressList $origin,
36  protected string $installationHost,
38  ) {
39  $this->getUsrIdByLoginCallable = $getUsrIdByLoginCallable;
40  }
41 
42  public function value(): 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  }
59 }
Class ilMailOnlyExternalAddressList.
Interface ilMailAddressList.
__construct(protected ilMailAddressList $origin, protected string $installationHost, callable $getUsrIdByLoginCallable)
Class ilMailAddress.