ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMailOnlyExternalAddressList.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
25
29 public function __construct(
30 protected ilMailAddressList $origin,
31 protected string $installation_host,
33 ) {
34 $this->get_usr_id_by_login_callable = $get_usr_id_by_login_callable;
35 }
36
37 public function value(): array
38 {
39 $addresses = $this->origin->value();
40
41 return array_filter($addresses, function (ilMailAddress $address): bool {
42 if (($this->get_usr_id_by_login_callable)((string) $address)) {
43 // Fixed mantis bug #5875
44 return false;
45 }
46
47 if ($address->getHost() === $this->installation_host) {
48 return false;
49 }
50
51 return !str_starts_with($address->getMailbox(), '#');
52 });
53 }
54}
__construct(protected ilMailAddressList $origin, protected string $installation_host, callable $get_usr_id_by_login_callable)