ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLikeForumSearch Class Reference
+ Inheritance diagram for ilLikeForumSearch:
+ Collaboration diagram for ilLikeForumSearch:

Public Member Functions

 __createPostAndCondition ()
 
 __createTopicAndCondition ()
 
- Public Member Functions inherited from ilForumSearch
 performSearch ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct (ilQueryParser $qp_obj)
 
 setFields (array $a_fields)
 
 getFields ()
 
 setFilter (array $a_filter)
 
 setIdFilter (array $a_id_filter)
 
 getIdFilter ()
 
 appendToFilter (string $a_type)
 
 getFilter ()
 
 __createLocateString ()
 
 __prepareFound (object $row)
 
 performSearch ()
 

Additional Inherited Members

- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types
 

Detailed Description

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

Member Function Documentation

◆ __createPostAndCondition()

ilLikeForumSearch::__createPostAndCondition ( )

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

39  : string
40  {
41 
42  /*
43  $concat = " CONCAT(";
44  $concat .= 'pos_message,pos_subject';
45  $concat .= ") ";
46  */
47  $concat = $this->db->concat(
48  array(
49  array('pos_subject','text'),
50  array('pos_message','text'))
51  );
52 
53  $and = " AND ( ";
54  $counter = 0;
55  foreach ($this->query_parser->getQuotedWords() as $word) {
56  if ($counter++) {
57  $and .= " OR";
58  }
59  #$and .= $concat;
60  #$and .= ("LIKE ('%".$word."%')");
61  $and .= $this->db->like($concat, 'clob', '%' . $word . '%');
62  }
63  return $and . ") ";
64  }

◆ __createTopicAndCondition()

ilLikeForumSearch::__createTopicAndCondition ( )

Definition at line 66 of file class.ilLikeForumSearch.php.

66  : string
67  {
68  $field = 'thr_subject ';
69  $and = " AND( ";
70 
71  $counter = 0;
72  foreach ($this->query_parser->getQuotedWords() as $word) {
73  if ($counter++) {
74  $and .= " OR ";
75  }
76  #$and .= $field;
77  #$and .= ("LIKE ('%".$word."%')");
78  $and .= $this->db->like($field, 'text', '%' . $word . '%');
79  }
80  return $and . " ) ";
81  }

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