ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
RecipientSearchProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27abstract class RecipientSearchProvider implements \Iterator
28{
29 protected \ilDBInterface $db;
30 protected ?\ilDBStatement $res = null;
32 protected ?array $data = null;
33 protected int $user_id = 0;
34
35 public function __construct(protected string $quoted_term, protected string $term)
36 {
37 global $DIC;
38
39 $this->db = $DIC->database();
40 $this->user_id = $DIC->user()->getId();
41 }
42
43 public function valid(): bool
44 {
45 $this->data = $this->db->fetchAssoc($this->res);
46
47 return \is_array($this->data) && !empty($this->data);
48 }
49
50 public function next(): void
51 {
52 }
53
54 public function __destruct()
55 {
56 if ($this->res !== null) {
57 $this->db->free($this->res);
58 $this->res = null;
59 }
60 }
61}
@phpstan-type AutoCompleteUserRecord array{login?: string, firstname?: string, lastname?...
__construct(protected string $quoted_term, protected string $term)
Interface ilDBStatement.
global $DIC
Definition: shib_login.php:26