ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilMailForm.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26
28{
32 public function getRecipientAsync(string $quoted_term, string $term, bool $do_recipient_search = true): array
33 {
34 global $DIC;
35
36 $http = $DIC->http();
37 $refinery = $DIC->refinery();
38
39 $mode = LegacyAutocompleteSearchResult::MODE_STOP_ON_MAX_ENTRIES;
40 if (
41 $http->wrapper()->query()->has('fetchall') &&
42 $http->wrapper()->query()->retrieve('fetchall', $refinery->kindlyTo()->bool())
43 ) {
44 $mode = LegacyAutocompleteSearchResult::MODE_FETCH_ALL;
45 }
46
47 $result = new LegacyAutocompleteSearchResult($mode);
48
49 $search = new Search($result);
50 if ($do_recipient_search) {
51 $search->addProvider(new SentMailsBasedProvider($quoted_term, $term));
52 }
53 $search->addProvider(new MailRecipientSearchProvider($quoted_term, $term));
54 if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
55 $search->addProvider(new LegacyUserSearchBasedProvider($quoted_term, $term));
56 }
57 $search->search();
58
59 return $result->getItems();
60 }
61}
@phpstan-type AutoCompleteUserItem array{label: string, value: string} @phpstan-type AutoCompleteResu...
@phpstan-import-type AutoCompleteUserRecord from RecipientSearchProvider
@phpstan-import-type AutoCompleteUserRecord from RecipientSearchProvider
Definition: Search.php:27
@phpstan-import-type AutoCompleteUserRecord from RecipientSearchProvider
getRecipientAsync(string $quoted_term, string $term, bool $do_recipient_search=true)
$http
Definition: deliver.php:30
global $DIC
Definition: shib_login.php:26