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

Public Member Functions

 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.ilForumSearch.php.

Member Function Documentation

◆ performSearch()

ilForumSearch::performSearch ( )

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

References $query, $res, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), 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(
61  (int) $row->frm_id,
62  'frm',
63  $this->__prepareFound($row),
64  (int) $thread_post
65  );
66  }
67 
68  // First: search post title, content:
69  $this->setFields(array('pos_subject','pos_message'));
70 
71  $and = $this->__createPostAndCondition();
72  $locate = $this->__createLocateString();
73 
74  $query = "SELECT top_frm_fk frm_id,pos_thr_fk,pos_pk " .
75  $locate .
76  "FROM frm_posts,frm_data " .
77  "WHERE pos_top_fk = top_pk " .
78  $and;
79 
80  $res = $this->db->query($query);
81  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
82  #$thread_post = $row->pos_thr_fk.'_'.$row->pos_pk;
83  $thread_post = $row->pos_thr_fk;
84  $this->search_result->addEntry(
85  (int) $row->frm_id,
86  'frm',
87  $this->__prepareFound($row),
88  (int) $thread_post
89  );
90  }
91  return $this->search_result;
92  }
$res
Definition: ltiservices.php:69
setFields(array $a_fields)
$query
ilSearchResult $search_result
+ Here is the call graph for this function:

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