ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilTestSearch.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
29 {
31  {
32  $this->setFields(array('introduction'));
33 
34  $where = $this->__createWhereCondition();
35  $locate = $this->__createLocateString();
36 
37  $query = "SELECT obj_fi " .
38  $locate .
39  "FROM tst_tests " .
40  $where;
41 
42  $res = $this->db->query($query);
43  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
44  $this->search_result->addEntry(
45  (int) $row->obj_fi,
46  'tst',
47  $this->__prepareFound($row)
48  );
49  }
50  return $this->search_result;
51  }
52 
53  public function __searchTestTitle(): ilSearchResult
54  {
55  $this->setFields(array('title','description'));
56 
57  $where = $this->__createWhereCondition();
58  $locate = $this->__createLocateString();
59 
60  $query = "SELECT obj_fi " .
61  $locate .
62  "FROM qpl_questions " .
63  $where;
64 
65  $res = $this->db->query($query);
66  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
67  $this->search_result->addEntry(
68  (int) $row->obj_fi,
69  'qpl',
70  $this->__prepareFound($row)
71  );
72  }
73  return $this->search_result;
74  }
76  {
77  $this->setFields(array('introduction'));
78 
79  $where = $this->__createWhereCondition();
80  $locate = $this->__createLocateString();
81 
82  $query = "SELECT obj_fi " .
83  $locate .
84  "FROM svy_svy " .
85  $where;
86 
87  $res = $this->db->query($query);
88  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
89  $this->search_result->addEntry(
90  (int) $row->obj_fi,
91  'svy',
92  $this->__prepareFound($row)
93  );
94  }
95  return $this->search_result;
96  }
98  {
99  $this->setFields(array('title','description'));
100 
101  $where = $this->__createWhereCondition();
102  $locate = $this->__createLocateString();
103 
104  $query = "SELECT obj_fi " .
105  $locate .
106  "FROM svy_question " .
107  $where;
108 
109  $res = $this->db->query($query);
110  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111  $this->search_result->addEntry(
112  (int) $row->obj_fi,
113  'spl',
114  $this->__prepareFound($row)
115  );
116  }
117  return $this->search_result;
118  }
119 
120 
121  public function performSearch(): ilSearchResult
122  {
123  $this->__searchTestTitle();
124  $this->__searchTestIntroduction();
125  $this->__searchSurveyTitle();
127  return $this->search_result;
128  }
129 }
$res
Definition: ltiservices.php:69
setFields(array $a_fields)
$query
ilSearchResult $search_result