ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
e
f
g
h
i
j
l
m
n
p
r
s
t
u
w
+
Functions
_
a
b
c
e
f
g
h
i
m
n
p
r
s
t
u
w
Variables
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
§
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
§
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
(
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Modules
Pages
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
$ilDB
;
54
55
$this->query_parser = $qp_obj;
56
$this->db =
$ilDB
;
57
58
include_once
'Services/Search/classes/class.ilSearchResult.php'
;
59
60
$this->search_result =
new
ilSearchResult
();
61
}
62
69
public
function
setMode
($a_mode)
70
{
71
$this->mode = $a_mode;
72
}
73
public
function
getMode
()
74
{
75
return
$this->mode
;
76
}
77
78
79
public
function
&
performSearch
()
80
{
81
switch
($this->
getMode
()) {
82
case
'all'
:
83
break
;
84
case
'keyword'
:
85
return
$this->
__searchKeywordsOnly
();
86
break
;
87
88
default
:
89
echo
"ilMDSearch::performSearch() no mode given"
;
90
return
false
;
91
}
92
}
93
94
95
96
// Private
97
public
function
__searchKeywordsOnly
()
98
{
99
$where =
" WHERE "
;
100
$field =
" keyword "
;
101
$counter
= 0;
102
foreach
($this->query_parser->getQuotedWords() as $word) {
103
if
(
$counter
++) {
104
$where .= strtoupper($this->query_parser->getCombination());
105
}
106
$where .= $field;
107
$where .= (
"LIKE ("
.
$ilDB
->quote(
"%"
. $word .
"%"
) .
")"
);
108
}
109
110
$query
=
"SELECT * FROM il_meta_keyword"
.
111
$where .
112
"ORDER BY meta_keyword_id DESC"
;
113
114
$res
= $this->db->query(
$query
);
115
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
116
$this->search_result->addEntry(
$row
->obj_id,
$row
->obj_type,
$row
->rbac_id);
117
}
118
119
return
$this->search_result;
120
}
121
}
ilMDSearch\getMode
getMode()
Definition:
class.ilMDSearch.php:73
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:97
$counter
$counter
Definition:
config-scanner.php:59
$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:69
$query
$query
Definition:
proxy_ylocal.php:13
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilMDSearch\$mode
$mode
Definition:
class.ilMDSearch.php:38
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilSearchResult
Definition:
class.ilSearchResult.php:40
ilMDSearch\performSearch
& performSearch()
Definition:
class.ilMDSearch.php:79
Services
MetaData
classes
class.ilMDSearch.php
Generated on Tue Apr 22 2025 19:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)