ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  {
46  }
47 
49  {
50  global $ilDB;
51 
52  if($this->options['lom_taxon'])
53  {
54  $where = " WHERE (";
55 
56  $counter = 0;
57  foreach($this->query_parser->getQuotedWords() as $word)
58  {
59  if($counter++)
60  {
61  $where .= "OR";
62  }
63 
64  $where .= $ilDB->like('taxon','text','%'.$word.'%');
65  }
66  $where .= ') ';
67  return $where;
68  }
69  return '';
70  }
71 
73  {
74  global $ilDB;
75 
76  $where = " WHERE (";
77 
78  $counter = 0;
79  foreach($this->query_parser->getQuotedWords() as $word)
80  {
81  if($counter++)
82  {
83  $where .= "OR";
84  }
85 
86  $where .= $ilDB->like('keyword','text','%'.$word.'%');
87  }
88  $where .= ') ';
89  return $where;
90  }
91 
93  {
94  global $ilDB;
95 
96  if($this->options['lom_version'])
97  {
98  $where = " WHERE (";
99 
100  $counter = 0;
101  foreach($this->query_parser->getQuotedWords() as $word)
102  {
103  if($counter++)
104  {
105  $where .= "OR";
106  }
107 
108  $where .= $ilDB->like('meta_version','text','%'.$word.'%');
109  }
110  $where .= ') ';
111  return $where;
112  }
113  return '';
114  }
115 
117  {
118  global $ilDB;
119 
120  if($this->options['lom_role_entry'])
121  {
122  $where = " WHERE (";
123 
124  $counter = 0;
125  foreach($this->query_parser->getQuotedWords() as $word)
126  {
127  if($counter++)
128  {
129  $where .= "OR";
130  }
131 
132  $where .= $ilDB->like('entity','text','%'.$word.'%');
133  }
134  $where .= ') ';
135  return $where;
136  }
137  return '';
138  }
139 
141  {
142  global $ilDB;
143 
144  if($this->options['lom_coverage'])
145  {
146  $where = " AND (";
147 
148  $counter = 0;
149  foreach($this->query_parser->getQuotedWords() as $word)
150  {
151  if($counter++)
152  {
153  $where .= "OR";
154  }
155 
156  $where .= $ilDB->like('coverage','text','%'.$word.'%');
157  }
158  $where .= ') ';
159  return $where;
160  }
161  return '';
162  }
163 
165  {
166  global $ilDB;
167 
168  $concat = $ilDB->concat(
169  array(
170  array('title','text'),
171  array('description','text')));
172 
173  $where = " WHERE (";
174 
175  $counter = 0;
176  foreach($this->query_parser->getQuotedWords() as $word)
177  {
178  if($counter++)
179  {
180  $where .= "OR";
181  }
182 
183  $where .= $ilDB->like($concat,'text','%'.$word.'%');
184  }
185  $where .= ') ';
186 
187  return $where;
188  }
189 
190 
191 }