ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilUserSearch Class Reference
+ Inheritance diagram for ilUserSearch:
+ Collaboration diagram for ilUserSearch:

Public Member Functions

 enableActiveCheck ($a_enabled)
 search only active accounts More...
 
 enableInactiveCheck ($a_enabled)
 search only inactive accounts More...
 
 performSearch ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct ($qp_obj)
 Constructor public. More...
 
 setFields ($a_fields)
 Set fields to search. More...
 
 getFields ()
 Get fields to search. More...
 
 setFilter ($a_filter)
 set object type to search in More...
 
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id. More...
 
 getIdFilter ()
 Get Id filter. More...
 
 appendToFilter ($a_type)
 Append object type to filter. More...
 
 getFilter ()
 get object type to search in More...
 
 __createLocateString ()
 build locate string in case of AND search More...
 
 __prepareFound (&$row)
 
 performSearch ()
 

Private Attributes

 $active_check = false
 
 $inactive_check = false
 

Additional Inherited Members

- Data Fields inherited from ilAbstractSearch
 $db = null
 
 $query_parser = null
 
 $search_result = null
 
 $object_types
 

Detailed Description

Definition at line 35 of file class.ilUserSearch.php.

Member Function Documentation

◆ enableActiveCheck()

ilUserSearch::enableActiveCheck (   $a_enabled)

search only active accounts

public

Parameters

Definition at line 47 of file class.ilUserSearch.php.

48  {
49  $this->active_check = $a_enabled;
50  }

◆ enableInactiveCheck()

ilUserSearch::enableInactiveCheck (   $a_enabled)

search only inactive accounts

public

Parameters

Definition at line 59 of file class.ilUserSearch.php.

60  {
61  $this->inactive_check = $a_enabled;
62  }

◆ performSearch()

ilUserSearch::performSearch ( )

Definition at line 64 of file class.ilUserSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), and ilDBConstants\FETCHMODE_OBJECT.

65  {
66  $where = $this->__createWhereCondition();
67  $locate = $this->__createLocateString();
68 
69  $query = "SELECT usr_id " .
70  $locate .
71  "FROM usr_data " .
72  $where;
73  if ($this->active_check) {
74  $query .= 'AND active = 1 ';
75  } elseif ($this->inactive_check) {
76  $query .= 'AND active = 0 ';
77  }
78 
79 
80  $res = $this->db->query($query);
81  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
82  $this->search_result->addEntry($row->usr_id, 'usr', $this->__prepareFound($row));
83  }
84  return $this->search_result;
85  }
__createLocateString()
build locate string in case of AND search
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:

Field Documentation

◆ $active_check

ilUserSearch::$active_check = false
private

Definition at line 37 of file class.ilUserSearch.php.

◆ $inactive_check

ilUserSearch::$inactive_check = false
private

Definition at line 38 of file class.ilUserSearch.php.


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