ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilMDSearch.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
36
class
ilMDSearch
37
{
38
public
$mode
=
''
;
39
40
/*
41
* instance of query parser
42
*/
43
public
$query_parser
= null;
44
45
public
$db
= null;
46
51
public
function
__construct
($qp_obj)
52
{
53
global
$DIC
;
54
55
$ilDB
= $DIC[
'ilDB'
];
56
57
$this->query_parser = $qp_obj;
58
$this->db =
$ilDB
;
59
60
include_once
'Services/Search/classes/class.ilSearchResult.php'
;
61
62
$this->search_result =
new
ilSearchResult
();
63
}
64
71
public
function
setMode
($a_mode)
72
{
73
$this->mode = $a_mode;
74
}
75
public
function
getMode
()
76
{
77
return
$this->mode
;
78
}
79
80
81
public
function
&
performSearch
()
82
{
83
switch
($this->
getMode
()) {
84
case
'all'
:
85
break
;
86
case
'keyword'
:
87
return
$this->
__searchKeywordsOnly
();
88
break
;
89
90
default
:
91
echo
"ilMDSearch::performSearch() no mode given"
;
92
return
false
;
93
}
94
}
95
96
97
98
// Private
99
public
function
__searchKeywordsOnly
()
100
{
101
$where =
" WHERE "
;
102
$field =
" keyword "
;
103
$counter = 0;
104
foreach
($this->query_parser->getQuotedWords() as $word) {
105
if
($counter++) {
106
$where .= strtoupper($this->query_parser->getCombination());
107
}
108
$where .= $field;
109
$where .= (
"LIKE ("
.
$ilDB
->quote(
"%"
. $word .
"%"
) .
")"
);
110
}
111
112
$query
=
"SELECT * FROM il_meta_keyword"
.
113
$where .
114
"ORDER BY meta_keyword_id DESC"
;
115
116
$res
= $this->db->query(
$query
);
117
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
118
$this->search_result->addEntry(
$row
->obj_id,
$row
->obj_type,
$row
->rbac_id);
119
}
120
121
return
$this->search_result;
122
}
123
}
ilMDSearch\getMode
getMode()
Definition:
class.ilMDSearch.php:75
$DIC
global $DIC
Definition:
saml.php:7
ilMDSearch\__construct
__construct($qp_obj)
Constructor public.
Definition:
class.ilMDSearch.php:51
ilMDSearch\$db
$db
Definition:
class.ilMDSearch.php:45
ilMDSearch\$query_parser
$query_parser
Definition:
class.ilMDSearch.php:43
ilMDSearch\__searchKeywordsOnly
__searchKeywordsOnly()
Definition:
class.ilMDSearch.php:99
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMDSearch
Definition:
class.ilMDSearch.php:36
ilMDSearch\setMode
setMode($a_mode)
Define meta elements to search.
Definition:
class.ilMDSearch.php:71
$query
$query
Definition:
proxy_ylocal.php:13
$row
$row
Definition:
migrateto20.php:360
echo
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDSearch\$mode
$mode
Definition:
class.ilMDSearch.php:38
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilSearchResult
Definition:
class.ilSearchResult.php:40
ilMDSearch\performSearch
& performSearch()
Definition:
class.ilMDSearch.php:81
Services
MetaData
classes
class.ilMDSearch.php
Generated on Thu Feb 27 2025 19:02:01 for ILIAS by
1.8.13 (using
Doxyfile
)