ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilLikeUserDefinedFieldSearch.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
'Services/Search/classes/class.ilUserDefinedFieldSearch.php'
;
5
17
class
ilLikeUserDefinedFieldSearch
extends
ilUserDefinedFieldSearch
18
{
19
25
public
function
setFields
($a_fields)
26
{
27
foreach
($a_fields as $field) {
28
$fields[] =
'f_'
. $field;
29
}
30
parent::setFields($fields ? $fields : array());
31
}
32
33
34
public
function
__createWhereCondition
()
35
{
36
global
$DIC
;
37
38
$ilDB
= $DIC[
'ilDB'
];
39
40
$fields = $this->
getFields
();
41
$field = $fields[0];
42
43
$and =
" WHERE field_id = "
.
$ilDB
->quote((
int
) substr($field, 2),
"integer"
) .
" AND ( "
;
44
$counter = 0;
45
foreach
($this->query_parser->getQuotedWords() as $word) {
46
if
($counter++) {
47
$and .=
" OR "
;
48
}
49
50
if
(strpos($word,
'^'
) === 0) {
51
$and .=
$ilDB
->like(
"value"
,
"text"
, substr($word, 1) .
"%"
);
52
}
else
{
53
$and .=
$ilDB
->like(
"value"
,
"text"
,
"%"
. $word .
"%"
);
54
}
55
}
56
return
$and .
") "
;
57
}
58
}
ilAbstractSearch\getFields
getFields()
Get fields to search.
Definition:
class.ilAbstractSearch.php:74
$DIC
global $DIC
Definition:
saml.php:7
ilLikeUserDefinedFieldSearch
Definition:
class.ilLikeUserDefinedFieldSearch.php:17
ilUserDefinedFieldSearch
Class ilUserSearch.
Definition:
class.ilUserDefinedFieldSearch.php:14
ilLikeUserDefinedFieldSearch\setFields
setFields($a_fields)
Definition:
class.ilLikeUserDefinedFieldSearch.php:25
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilLikeUserDefinedFieldSearch\__createWhereCondition
__createWhereCondition()
Definition:
class.ilLikeUserDefinedFieldSearch.php:34
Services
Search
classes
Like
class.ilLikeUserDefinedFieldSearch.php
Generated on Thu Jan 16 2025 19:02:29 for ILIAS by
1.8.13 (using
Doxyfile
)