ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLikeUserSearch Class Reference
+ Inheritance diagram for ilLikeUserSearch:
+ Collaboration diagram for ilLikeUserSearch:

Public Member Functions

 __createWhereCondition ()
 
- Public Member Functions inherited from ilUserSearch
 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 @access 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 ()
 

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

◆ __createWhereCondition()

ilLikeUserSearch::__createWhereCondition ( )

Definition at line 39 of file class.ilLikeUserSearch.php.

40 {
41 global $DIC;
42
43 $ilDB = $DIC['ilDB'];
44
45 $fields = $this->getFields();
46 $field = $fields[0] . ' ';
47
48 $and = " WHERE ( ";
49
50 $counter = 0;
51 foreach ($this->query_parser->getQuotedWords() as $word) {
52 if ($counter++) {
53 $and .= " OR ";
54 }
55
56 #$and .= $field;
57
58 if (strpos($word, '^') === 0) {
59 $and .= $ilDB->like($field, 'text', substr($word, 1) . '%');
60 #$and .= ("LIKE ('".substr($word,1)."%')");
61 } else {
62 $and .= $ilDB->like($field, 'text', '%' . $word . '%');
63 #$and .= ("LIKE ('%".$word."%')");
64 }
65 }
66
67 return $and . ") ";
68 }
getFields()
Get fields to search.
global $DIC
Definition: goto.php:24
global $ilDB

References $DIC, $ilDB, and ilAbstractSearch\getFields().

+ Here is the call graph for this function:

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