ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilMailAutoCompleteAddressbookEmailProvider Class Reference

Class ilMailAutoCompleteAddressbookEmailProvider. More...

+ Inheritance diagram for ilMailAutoCompleteAddressbookEmailProvider:
+ Collaboration diagram for ilMailAutoCompleteAddressbookEmailProvider:

Public Member Functions

 current ()
 "Current" implementation of iterator interface More...
 
 key ()
 "Key" implementation of iterator interface More...
 
 rewind ()
 "Rewind "implementation of iterator interface More...
 
- Public Member Functions inherited from ilMailAutoCompleteRecipientProvider
 valid ()
 "Valid" implementation of iterator interface More...
 
 next ()
 "Next" implementation of iterator interface More...
 
 __destruct ()
 Destructor Free the result. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilMailAutoCompleteRecipientProvider
 $db
 
 $res
 
 $data = array()
 
 $quoted_term = ''
 
 $term = ''
 
 $user_id = 0
 

Detailed Description

Member Function Documentation

◆ current()

ilMailAutoCompleteAddressbookEmailProvider::current ( )

"Current" implementation of iterator interface

Returns
array

Definition at line 15 of file class.ilMailAutoCompleteAddressbookEmailProvider.php.

16 {
17 return array(
18 'login' => $this->data['login'],
19 'firstname' => $this->data['firstname'],
20 'lastname' => $this->data['lastname']
21 );
22 }

◆ key()

ilMailAutoCompleteAddressbookEmailProvider::key ( )

"Key" implementation of iterator interface

Returns
boolean true/false

Definition at line 28 of file class.ilMailAutoCompleteAddressbookEmailProvider.php.

29 {
30 return $this->data['login'];
31 }

◆ rewind()

ilMailAutoCompleteAddressbookEmailProvider::rewind ( )

"Rewind "implementation of iterator interface

Definition at line 36 of file class.ilMailAutoCompleteAddressbookEmailProvider.php.

37 {
38 if($this->res)
39 {
40 $this->db->free($this->res);
41 $this->res = null;
42 }
43
44 $query = "
45 SELECT DISTINCT
46 abook.email login,
47 abook.firstname firstname,
48 abook.lastname lastname
49 FROM addressbook abook
50 WHERE abook.user_id = " . $this->db->quote($this->user_id, 'integer') . "
51 AND abook.login IS NULL
52 AND (" .
53 $this->db->like('abook.email', 'text', $this->quoted_term) . " OR " .
54 $this->db->like('abook.firstname', 'text', $this->quoted_term) . " OR " .
55 $this->db->like('abook.lastname', 'text', $this->quoted_term) . " )";
56 $this->res = $this->db->query($query);
57 }

References $query.


The documentation for this class was generated from the following file: