ILIAS  release_8 Revision v8.24
class.ilMailAutoCompleteRecipientProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24abstract class ilMailAutoCompleteRecipientProvider implements Iterator
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
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...