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