ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMailAutoCompleteRecipientProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
26  protected ilDBInterface $db;
27  protected ?ilDBStatement $res = null;
29  protected ?array $data = null;
30  protected string $quoted_term ;
31  protected string $term = '';
32  protected int $user_id = 0;
33 
34  public function __construct(string $quoted_term, string $term)
35  {
36  global $DIC;
37 
38  $this->db = $DIC->database();
39  $this->quoted_term = $quoted_term;
40  $this->term = $term;
41  $this->user_id = $DIC->user()->getId();
42  }
43 
44  public function valid(): bool
45  {
46  $this->data = $this->db->fetchAssoc($this->res);
47 
48  return is_array($this->data) && !empty($this->data);
49  }
50 
51  public function next(): void
52  {
53  }
54 
55  public function __destruct()
56  {
57  if ($this->res) {
58  $this->db->free($this->res);
59  $this->res = null;
60  }
61  }
62 }
global $DIC
Definition: feed.php:28