ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLikeObjectSearch Class Reference
+ Inheritance diagram for ilLikeObjectSearch:
+ Collaboration diagram for ilLikeObjectSearch:

Public Member Functions

 __createWhereCondition ()
 
- Public Member Functions inherited from ilObjectSearch
 __construct (&$qp_obj)
 Constructor public. More...
 
 performSearch ()
 
 __createInStatement ()
 
 setCreationDateFilterDate (ilDate $day)
 Set creation date filter. More...
 
 setCreationDateFilterOperator ($a_operator)
 
 getCreationDateFilterDate ()
 
 getCreationDateFilterOperator ()
 
- 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 ilObjectSearch
const CDATE_OPERATOR_BEFORE = 1
 
const CDATE_OPERATOR_AFTER = 2
 
const CDATE_OPERATOR_ON = 3
 
- Data Fields inherited from ilAbstractSearch
 $db = null
 
 $query_parser = null
 
 $search_result = null
 
 $object_types
 

Detailed Description

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

Member Function Documentation

◆ __createWhereCondition()

ilLikeObjectSearch::__createWhereCondition ( )

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

References $DIC, and $ilDB.

40  {
41  global $DIC;
42 
43  $ilDB = $DIC['ilDB'];
44 
45  /*
46  $concat = " CONCAT(";
47  $concat .= 'title,description';
48  $concat .= ") ";
49  */
50 
51  $concat = $ilDB->concat(
52  array(
53  array('title','text'),
54  array('description','text'))
55  );
56 
57 
58  $where = "WHERE (";
59  $counter = 0;
60  foreach ($this->query_parser->getQuotedWords() as $word) {
61  if ($counter++) {
62  $where .= "OR";
63  }
64 
65  $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
66 
67  #$where .= $concat;
68  #$where .= ("LIKE ('%".$word."%') ");
69  }
70  $where .= ') ';
71  return $where;
72  }
global $DIC
Definition: saml.php:7
global $ilDB

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