ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLikeAdvancedSearch.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 
24 include_once 'Services/Search/classes/class.ilAdvancedSearch.php';
25 
38 {
43  public function __construct($qp)
44  {
45  parent::__construct($qp);
46  }
47 
48  public function __createTaxonWhereCondition()
49  {
50  global $DIC;
51 
52  $ilDB = $DIC['ilDB'];
53 
54  if ($this->options['lom_taxon']) {
55  $where = " WHERE (";
56 
57  $counter = 0;
58  foreach ($this->query_parser->getQuotedWords() as $word) {
59  if ($counter++) {
60  $where .= "OR";
61  }
62 
63  $where .= $ilDB->like('taxon', 'text', '%' . $word . '%');
64  }
65  $where .= ') ';
66  return $where;
67  }
68  return '';
69  }
70 
72  {
73  global $DIC;
74 
75  $ilDB = $DIC['ilDB'];
76 
77  $where = " WHERE (";
78 
79  $counter = 0;
80  foreach ($this->query_parser->getQuotedWords() as $word) {
81  if ($counter++) {
82  $where .= "OR";
83  }
84 
85  $where .= $ilDB->like('keyword', 'text', '%' . $word . '%');
86  }
87  $where .= ') ';
88  return $where;
89  }
90 
92  {
93  global $DIC;
94 
95  $ilDB = $DIC['ilDB'];
96 
97  if ($this->options['lom_version']) {
98  $where = " WHERE (";
99 
100  $counter = 0;
101  foreach ($this->query_parser->getQuotedWords() as $word) {
102  if ($counter++) {
103  $where .= "OR";
104  }
105 
106  $where .= $ilDB->like('meta_version', 'text', '%' . $word . '%');
107  }
108  $where .= ') ';
109  return $where;
110  }
111  return '';
112  }
113 
115  {
116  global $DIC;
117 
118  $ilDB = $DIC['ilDB'];
119 
120  if ($this->options['lom_role_entry']) {
121  $where = " WHERE (";
122 
123  $counter = 0;
124  foreach ($this->query_parser->getQuotedWords() as $word) {
125  if ($counter++) {
126  $where .= "OR";
127  }
128 
129  $where .= $ilDB->like('entity', 'text', '%' . $word . '%');
130  }
131  $where .= ') ';
132  return $where;
133  }
134  return '';
135  }
136 
138  {
139  global $DIC;
140 
141  $ilDB = $DIC['ilDB'];
142 
143  if ($this->options['lom_coverage']) {
144  $where = " AND (";
145 
146  $counter = 0;
147  foreach ($this->query_parser->getQuotedWords() as $word) {
148  if ($counter++) {
149  $where .= "OR";
150  }
151 
152  $where .= $ilDB->like('coverage', 'text', '%' . $word . '%');
153  }
154  $where .= ') ';
155  return $where;
156  }
157  return '';
158  }
159 
161  {
162  global $DIC;
163 
164  $ilDB = $DIC['ilDB'];
165 
166  $concat = $ilDB->concat(
167  array(
168  array('title','text'),
169  array('description','text'))
170  );
171 
172  $where = " WHERE (";
173 
174  $counter = 0;
175  foreach ($this->query_parser->getQuotedWords() as $word) {
176  if ($counter++) {
177  $where .= "OR";
178  }
179 
180  $where .= $ilDB->like($concat, 'text', '%' . $word . '%');
181  }
182  $where .= ') ';
183 
184  return $where;
185  }
186 }
global $DIC
Definition: saml.php:7
global $ilDB