ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 87 of file class.ilForumSearch.php.

88  {
89  echo "Overwrite me!";
90  }

◆ performSearch()

& ilForumSearch::performSearch ( )

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

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

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

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