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

Public Member Functions

 performSearch ()
 
 __createAndCondition ()
 
- 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 37 of file class.ilForumSearch.php.

Member Function Documentation

◆ __createAndCondition()

ilForumSearch::__createAndCondition ( )

Definition at line 84 of file class.ilForumSearch.php.

85  {
86  echo "Overwrite me!";
87  }

◆ performSearch()

ilForumSearch::performSearch ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\setFields().

40  {
41  // Search in topic titles, posting title, posting
42 
43  // First: search topics:
44  $this->setFields(array('thr_subject'));
45 
46  $and = $this->__createTopicAndCondition();
47  $locate = $this->__createLocateString();
48 
49  $query = "SELECT thr_pk,top_frm_fk frm_id " .
50  $locate .
51  "FROM frm_threads,frm_data " .
52  "WHERE top_pk = thr_top_fk " .
53  $and;
54 
55  $res = $this->db->query($query);
56 
57  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
58  #$thread_post = $row->thr_pk.'_0';
59  $thread_post = $row->thr_pk;
60  $this->search_result->addEntry($row->frm_id, 'frm', $this->__prepareFound($row), $thread_post);
61  }
62 
63  // First: search post title, content:
64  $this->setFields(array('pos_subject','pos_message'));
65 
66  $and = $this->__createPostAndCondition();
67  $locate = $this->__createLocateString();
68 
69  $query = "SELECT top_frm_fk frm_id,pos_thr_fk,pos_pk " .
70  $locate .
71  "FROM frm_posts,frm_data " .
72  "WHERE pos_top_fk = top_pk " .
73  $and;
74 
75  $res = $this->db->query($query);
76  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
77  #$thread_post = $row->pos_thr_fk.'_'.$row->pos_pk;
78  $thread_post = $row->pos_thr_fk;
79  $this->search_result->addEntry($row->frm_id, 'frm', $this->__prepareFound($row), $thread_post);
80  }
81  return $this->search_result;
82  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the call graph for this function:

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