ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 Member Functions inherited from ilAbstractSearch
 getValidObjectTypes (ilObjectDefinition $object_definition)
 
- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types = []
 

Detailed Description

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

Member Function Documentation

◆ __createPostAndCondition()

ilLikeForumSearch::__createPostAndCondition ( )

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

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

◆ __createTopicAndCondition()

ilLikeForumSearch::__createTopicAndCondition ( )

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

58  : string
59  {
60  $field = 'thr_subject ';
61  $and = " AND( ";
62 
63  $counter = 0;
64  foreach ($this->query_parser->getQuotedWords() as $word) {
65  if ($counter++) {
66  $and .= " OR ";
67  }
68  #$and .= $field;
69  #$and .= ("LIKE ('%".$word."%')");
70  $and .= $this->db->like($field, 'text', '%' . $word . '%');
71  }
72  return $and . " ) ";
73  }

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