ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMailAutoCompleteUserProvider Class Reference

Class ilMailAutoCompleteUserProvider. More...

+ Inheritance diagram for ilMailAutoCompleteUserProvider:
+ Collaboration diagram for ilMailAutoCompleteUserProvider:

Public Member Functions

 __construct ($quoted_term, $term)
 
 valid ()
 "Valid" implementation of iterator interface More...
 
 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...
 

Protected Member Functions

 getSelectPart ()
 
 getOrderByPart ()
 
 getFields ()
 Get searchable fields. More...
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailAutoCompleteUserProvider::__construct (   $quoted_term,
  $term 
)

Member Function Documentation

◆ current()

ilMailAutoCompleteUserProvider::current ( )

"Current" implementation of iterator interface

Returns
array

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

37  {
38  return array(
39  'login' => $this->data['login'],
40  'firstname' => $this->data['firstname'],
41  'lastname' => $this->data['lastname']
42  );
43  }

◆ getFields()

ilMailAutoCompleteUserProvider::getFields ( )
protected

Get searchable fields.

Returns
array

Definition at line 221 of file class.ilMailAutoCompleteUserProvider.php.

References ilUserSearchOptions\_isEnabled().

Referenced by getSelectPart().

222  {
223  $available_fields = array();
224  foreach(array('login', 'firstname', 'lastname') as $field)
225  {
226  include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
228  {
229  $available_fields[] = $field;
230  }
231  }
232  return $available_fields;
233  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrderByPart()

ilMailAutoCompleteUserProvider::getOrderByPart ( )
protected
Returns
string

Definition at line 197 of file class.ilMailAutoCompleteUserProvider.php.

References $ilDB.

Referenced by rewind().

198  {
199  return 'login ASC';
200  }
+ Here is the caller graph for this function:

◆ getSelectPart()

ilMailAutoCompleteUserProvider::getSelectPart ( )
protected
Returns
string

Definition at line 80 of file class.ilMailAutoCompleteUserProvider.php.

References $ilDB, getFields(), ilUserAccountSettings\getInstance(), and ilUserFilter\getInstance().

Referenced by rewind().

81  {
82  $fields = array(
83  'login',
84  'firstname',
85  'lastname',
86  'email'
87  );
88 
89  $fields[] = 'profpref.value profile_value';
90  $fields[] = 'pubemail.value email_value';
91 
92  return implode(', ', $fields);
93  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ key()

ilMailAutoCompleteUserProvider::key ( )

"Key" implementation of iterator interface

Returns
boolean true/false

Definition at line 49 of file class.ilMailAutoCompleteUserProvider.php.

50  {
51  return $this->data['login'];
52  }

◆ rewind()

ilMailAutoCompleteUserProvider::rewind ( )

"Rewind "implementation of iterator interface

Definition at line 57 of file class.ilMailAutoCompleteUserProvider.php.

References $query, getOrderByPart(), and getSelectPart().

58  {
59  if($this->res)
60  {
61  $this->db->free($this->res);
62  $this->res = null;
63  }
64  $select_part = $this->getSelectPart();
65  $where_part = $this->getWherePart($this->quoted_term);
66  $order_by_part = $this->getOrderByPart();
67  $query = implode(" ", array(
68  'SELECT ' . $select_part,
69  'FROM ' . $this->getFromPart(),
70  $where_part ? 'WHERE ' . $where_part : '',
71  $order_by_part ? 'ORDER BY ' . $order_by_part : ''
72  ));
73 
74  $this->res = $this->db->query($query);
75  }
+ Here is the call graph for this function:

◆ valid()

ilMailAutoCompleteUserProvider::valid ( )

"Valid" implementation of iterator interface

Returns
boolean true/false

Definition at line 25 of file class.ilMailAutoCompleteUserProvider.php.

26  {
27  $this->data = $this->db->fetchAssoc($this->res);
28 
29  return is_array($this->data);
30  }

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