ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilTestSearch.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
35include_once 'Services/Search/classes/class.ilAbstractSearch.php';
36
38{
40 {
41 $this->setFields(array('introduction'));
42
43 $where = $this->__createWhereCondition(implode(',',$this->getFields()));
44 $locate = $this->__createLocateString();
45
46 $query = "SELECT obj_fi ".
47 $locate.
48 "FROM tst_tests ".
49 $where;
50
51 $res = $this->db->query($query);
52 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
53 {
54 $this->search_result->addEntry($row->obj_fi,'tst',$this->__prepareFound($row));
55 }
57 }
59 {
60 $this->setFields(array('title','description'));
61
62 $where = $this->__createWhereCondition(implode(',',$this->getFields()));
63 $locate = $this->__createLocateString();
64
65 $query = "SELECT obj_fi ".
66 $locate.
67 "FROM qpl_questions ".
68 $where;
69
70 $res = $this->db->query($query);
71 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
72 {
73 $this->search_result->addEntry($row->obj_fi,'qpl',$this->__prepareFound($row));
74 }
76 }
78 {
79 $this->setFields(array('introduction'));
80
81 $where = $this->__createWhereCondition(implode(',',$this->getFields()));
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 {
92 $this->search_result->addEntry($row->obj_fi,'svy',$this->__prepareFound($row));
93 }
95 }
97 {
98 $this->setFields(array('title','description'));
99
100 $where = $this->__createWhereCondition(implode(',',$this->getFields()));
101 $locate = $this->__createLocateString();
102
103 $query = "SELECT obj_fi ".
104 $locate.
105 "FROM svy_question ".
106 $where;
107
108 $res = $this->db->query($query);
109 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
110 {
111 $this->search_result->addEntry($row->obj_fi,'spl',$this->__prepareFound($row));
112 }
114 }
115
116
117 function &performSearch()
118 {
119 $this->__searchTestTitle();
121 $this->__searchSurveyTitle();
123
125 }
126}
127?>
An exception for terminatinating execution or to throw for unit testing.
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFields()
Get fields to search.