ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMailAutoCompleteRecipientProvider.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
3
7abstract class ilMailAutoCompleteRecipientProvider implements Iterator
8{
13 protected $db;
14
18 protected $res;
19
24 protected $data = array();
25
29 protected $quoted_term = '';
30
34 protected $term = '';
35
39 protected $user_id = 0;
40
45 public function __construct($quoted_term, $term)
46 {
47 global $DIC;
48
49 $this->db = $DIC->database();
50 $this->quoted_term = $quoted_term;
51 $this->term = $term;
52 $this->user_id = $DIC->user()->getId();
53 }
54
59 public function valid()
60 {
61 $this->data = $this->db->fetchAssoc($this->res);
62
63 return is_array($this->data);
64 }
65
69 public function next()
70 {
71 }
72
77 public function __destruct()
78 {
79 if ($this->res) {
80 $this->db->free($this->res);
81 $this->res = null;
82 }
83 }
84}
An exception for terminatinating execution or to throw for unit testing.
valid()
"Valid" implementation of iterator interface
next()
"Next" implementation of iterator interface
global $DIC
Definition: goto.php:24