ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilMailAutoCompleteSearch.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24  protected array $providers = [];
25 
26  public function __construct(protected ilMailAutoCompleteRecipientResult $result)
27  {
28  }
29 
30  public function addProvider(Iterator $provider): void
31  {
32  $this->providers[] = $provider;
33  }
34 
35  public function search(): void
36  {
37  foreach ($this->providers as $provider) {
38  foreach ($provider as $row) {
39  if (!$this->result->isResultAddable()) {
40  $this->result->result['hasMoreResults'] = true;
41  break 2;
42  }
43  $this->result->addResult($row['login'], $row['firstname'], $row['lastname']);
44  }
45  }
46  }
47 }
$provider
Definition: ltitoken.php:80
__construct(protected ilMailAutoCompleteRecipientResult $result)