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

Class ilMailAutoCompleteAddressbookLoginProvider. More...

+ Inheritance diagram for ilMailAutoCompleteAddressbookLoginProvider:
+ Collaboration diagram for ilMailAutoCompleteAddressbookLoginProvider:

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()

ilMailAutoCompleteAddressbookLoginProvider::current ( )

"Current" implementation of iterator interface

Returns
array

Definition at line 14 of file class.ilMailAutoCompleteAddressbookLoginProvider.php.

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

◆ key()

ilMailAutoCompleteAddressbookLoginProvider::key ( )

"Key" implementation of iterator interface

Returns
boolean true/false

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

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

◆ rewind()

ilMailAutoCompleteAddressbookLoginProvider::rewind ( )

"Rewind "implementation of iterator interface

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

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

References $query.


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