ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
UserSearchAutocompleteItemResult.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
28 private array $items = [];
30 private array $handled_recipients = [];
31
32 public function __construct(private readonly AutocompleteQuery $query)
33 {
34 }
35
36 public function addResult(string $identifier, string $firstname, string $lastname): SearchResultStatus
37 {
38 if (!isset($this->handled_recipients[$identifier])) {
39 $this->items[] = new \ILIAS\User\Search\DefaultAutocompleteItem(
40 $identifier,
41 $firstname,
42 $lastname,
43 $this->query->getUnprocessedSearchTerm()
44 );
45
46 $this->handled_recipients[$identifier] = true;
47
48 return SearchResultStatus::ADDED;
49 }
50
51 return SearchResultStatus::DUPLICATE;
52 }
53
54 public function markMoreResultsAvailable(): void
55 {
56 }
57
61 public function getItems(): array
62 {
63 return $this->items;
64 }
65}
addResult(string $identifier, string $firstname, string $lastname)
This class provides some pre-processing for search terms provided by a user when searching for users.