ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
Search.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26class Search
27{
29 private array $providers = [];
30
31 public function __construct(private readonly SearchResult $result)
32 {
33 }
34
38 public function addProvider(\Iterator $provider): void
39 {
40 $this->providers[] = $provider;
41 }
42
43 public function search(): void
44 {
45 foreach ($this->providers as $provider) {
46 $status = SearchResultStatus::INITIAL;
47 foreach ($provider as $row) {
48 if ($status === SearchResultStatus::LIMIT_REACHED) {
49 $this->result->markMoreResultsAvailable();
50 break 2;
51 }
52
53 $status = $this->result->addResult($row['login'], $row['firstname'], $row['lastname']);
54 }
55 }
56 }
57}
@phpstan-import-type AutoCompleteUserRecord from RecipientSearchProvider
Definition: Search.php:27
__construct(private readonly SearchResult $result)
Definition: Search.php:31
addProvider(\Iterator $provider)
Definition: Search.php:38
$provider
Definition: ltitoken.php:80