ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 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.ilForumSearch.php.

Member Function Documentation

◆ performSearch()

ilForumSearch::performSearch ( )

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

References $res, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilAbstractSearch\setFields().

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

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