ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilForumSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
31{
32 public function performSearch(): ilSearchResult
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 }
85 }
86}
setFields(array $a_fields)
ilSearchResult $search_result
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69