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

Public Member Functions

 setFields ($a_fields)
 
 __createWhereCondition ()
 
- Public Member Functions inherited from ilUserDefinedFieldSearch
 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 ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 17 of file class.ilLikeUserDefinedFieldSearch.php.

Member Function Documentation

◆ __createWhereCondition()

ilLikeUserDefinedFieldSearch::__createWhereCondition ( )

Definition at line 34 of file class.ilLikeUserDefinedFieldSearch.php.

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

35  {
36  global $ilDB;
37 
38  $fields = $this->getFields();
39  $field = $fields[0];
40 
41  $and = " WHERE field_id = " . $ilDB->quote((int) substr($field, 2), "integer") . " AND ( ";
42  $counter = 0;
43  foreach ($this->query_parser->getQuotedWords() as $word) {
44  if ($counter++) {
45  $and .= " OR ";
46  }
47 
48  if (strpos($word, '^') === 0) {
49  $and .= $ilDB->like("value", "text", substr($word, 1) . "%");
50  } else {
51  $and .= $ilDB->like("value", "text", "%" . $word . "%");
52  }
53  }
54  return $and . ") ";
55  }
getFields()
Get fields to search.
$counter
global $ilDB
+ Here is the call graph for this function:

◆ setFields()

ilLikeUserDefinedFieldSearch::setFields (   $a_fields)
Parameters

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

References array.

26  {
27  foreach ($a_fields as $field) {
28  $fields[] = 'f_' . $field;
29  }
30  parent::setFields($fields ? $fields : array());
31  }
Create styles array
The data for the language used.

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