ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAdvancedSearch Class Reference
+ Inheritance diagram for ilAdvancedSearch:
+ Collaboration diagram for ilAdvancedSearch:

Public Member Functions

 ilAdvancedSearch (&$qp_obj)
 Constructor @access public. More...
 
 setMode ($a_mode)
 Define meta elements to search. More...
 
 getMode ()
 
 setOptions (&$options)
 
performSearch ()
 
__searchTitleDescription ()
 
__searchGeneral ()
 
__searchLanguage ()
 
__searchContribute ()
 
__searchEntity ()
 
__searchRequirement ()
 
__searchEducational ()
 
__searchTypicalAgeRange ()
 
__searchRights ()
 
__searchClassification ()
 
__searchTaxon ()
 
__searchKeyword ($a_in_classification=false)
 
__searchLifecycle ()
 
__searchFormat ()
 
 __createRightsWhere ()
 
 __createClassificationWhere ()
 
 __createEducationalWhere ()
 
 __createRequirementWhere ()
 
 __getDifference ($a_val1, $a_val2, $options)
 
 __getInStatement ($a_fields)
 
- Public Member Functions inherited from ilAbstractSearch
 ilAbstractSearch (&$qp_obj)
 Constructor @access public. More...
 
 setFields ($a_fields)
 Set fields to search. More...
 
 getFields ()
 Get fields to search. More...
 
 setFilter ($a_filter)
 set object type to search in More...
 
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id. More...
 
 getIdFilter ()
 Get Id filter. More...
 
 appendToFilter ($a_type)
 Append object type to filter. More...
 
 getFilter ()
 get object type to search in More...
 
 __createLocateString ()
 build locate string in case of AND search More...
 
 __prepareFound (&$row)
 
performSearch ()
 

Data Fields

 $mode = ''
 
 $query_parser = null
 
 $db = null
 
- Data Fields inherited from ilAbstractSearch
 $db = null
 
 $query_parser = null
 
 $search_result = null
 
 $object_types
 

Detailed Description

Definition at line 37 of file class.ilAdvancedSearch.php.

Member Function Documentation

◆ __createClassificationWhere()

ilAdvancedSearch::__createClassificationWhere ( )

Definition at line 522 of file class.ilAdvancedSearch.php.

523 {
524 global $ilDB;
525
526 $counter = 0;
527 $where = 'WHERE ';
528
529
530 if($this->options['lom_purpose'])
531 {
532 $and = $counter++ ? 'AND ' : ' ';
533 $where .= ($and."purpose = ".$ilDB->quote($this->options['lom_purpose'])." ");
534 }
535 return $counter ? $where : '';
536 }
global $ilDB

References $ilDB.

Referenced by __searchClassification().

+ Here is the caller graph for this function:

◆ __createEducationalWhere()

ilAdvancedSearch::__createEducationalWhere ( )

Definition at line 537 of file class.ilAdvancedSearch.php.

538 {
539 global $ilDB;
540
541 $counter = 0;
542 $where = 'WHERE ';
543
544
545 if($this->options['lom_interactivity'])
546 {
547 $and = $counter++ ? 'AND ' : ' ';
548 $where .= ($and."interactivity_type = ".$ilDB->quote($this->options['lom_interactivity'] ,'text')." ");
549 }
550 if($this->options['lom_resource'])
551 {
552 $and = $counter++ ? 'AND ' : ' ';
553 $where .= ($and."learning_resource_type = ".$ilDB->quote($this->options['lom_resource'] ,'text')." ");
554 }
555 if($this->options['lom_user_role'])
556 {
557 $and = $counter++ ? 'AND ' : ' ';
558 $where .= ($and."intended_end_user_role = ".$ilDB->quote($this->options['lom_user_role'] ,'text')." ");
559 }
560 if($this->options['lom_context'])
561 {
562 $and = $counter++ ? 'AND ' : ' ';
563 $where .= ($and."context = ".$ilDB->quote($this->options['lom_context'] ,'text')." ");
564 }
565 if($this->options['lom_level_start'] or $this->options['lom_level_end'])
566 {
567 $and = $counter++ ? 'AND ' : ' ';
568
569 $fields = $this->__getDifference($this->options['lom_level_start'],$this->options['lom_level_end'],
570 array('VeryLow','Low','Medium','High','VeryHigh'));
571
572 $where .= ($and."interactivity_level ".$this->__getInStatement($fields));
573 }
574 if($this->options['lom_density_start'] or $this->options['lom_density_end'])
575 {
576 $and = $counter++ ? 'AND ' : ' ';
577
578 $fields = $this->__getDifference($this->options['lom_density_start'],$this->options['lom_density_end'],
579 array('VeryLow','Low','Medium','High','VeryHigh'));
580
581 $where .= ($and."semantic_density ".$this->__getInStatement($fields));
582 }
583 if($this->options['lom_difficulty_start'] or $this->options['lom_difficulty_end'])
584 {
585 $and = $counter++ ? 'AND ' : ' ';
586
587 $fields = $this->__getDifference($this->options['lom_difficulty_start'],$this->options['lom_difficulty_end'],
588 array('VeryEasy','Easy','Medium','Difficult','VeryDifficult'));
589
590 $where .= ($and."difficulty ".$this->__getInStatement($fields));
591 }
592
593 return $counter ? $where : '';
594 }
__getDifference($a_val1, $a_val2, $options)

References $ilDB, __getDifference(), and __getInStatement().

Referenced by __searchEducational().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __createRequirementWhere()

ilAdvancedSearch::__createRequirementWhere ( )

Definition at line 595 of file class.ilAdvancedSearch.php.

596 {
597 global $ilDB;
598
599 $counter = 0;
600 $where = 'WHERE ';
601
602
603 if($this->options['lom_operating_system'])
604 {
605 $and = $counter++ ? 'AND ' : ' ';
606 $where .= ($and."operating_system_name = ".$ilDB->quote($this->options['lom_operating_system'])." ");
607 }
608 if($this->options['lom_browser'])
609 {
610 $and = $counter++ ? 'AND ' : ' ';
611 $where .= ($and."browser_name = ".$ilDB->quote($this->options['lom_browser'])." ");
612 }
613 return $counter ? $where : '';
614 }

References $ilDB.

Referenced by __searchRequirement().

+ Here is the caller graph for this function:

◆ __createRightsWhere()

ilAdvancedSearch::__createRightsWhere ( )

Definition at line 502 of file class.ilAdvancedSearch.php.

503 {
504 global $ilDB;
505
506 $counter = 0;
507 $where = 'WHERE ';
508
509
510 if($this->options['lom_costs'])
511 {
512 $and = $counter++ ? 'AND ' : ' ';
513 $where .= ($and."costs = ".$ilDB->quote($this->options['lom_costs'] ,'text')." ");
514 }
515 if($this->options['lom_copyright'])
516 {
517 $and = $counter++ ? 'AND ' : ' ';
518 $where .= ($and."cpr_and_or = ".$ilDB->quote($this->options['lom_copyright'] ,'text')." ");
519 }
520 return $counter ? $where : '';
521 }

References $ilDB.

Referenced by __searchRights().

+ Here is the caller graph for this function:

◆ __getDifference()

ilAdvancedSearch::__getDifference (   $a_val1,
  $a_val2,
  $options 
)

Definition at line 616 of file class.ilAdvancedSearch.php.

617 {
618 $a_val2 = $a_val2 ? $a_val2 : count($options);
619 // Call again if a > b
620 if($a_val1 > $a_val2)
621 {
622 return $this->__getDifference($a_val2,$a_val1,$options);
623 }
624
625 $counter = 0;
626 foreach($options as $option)
627 {
628 if($a_val1 > ++$counter)
629 {
630 continue;
631 }
632 if($a_val2 < $counter)
633 {
634 break;
635 }
636 $fields[] = $option;
637 }
638 return $fields ? $fields : array();
639 }
if(!is_array($argv)) $options

References $options, and __getDifference().

Referenced by __createEducationalWhere(), and __getDifference().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getInStatement()

ilAdvancedSearch::__getInStatement (   $a_fields)

Definition at line 641 of file class.ilAdvancedSearch.php.

642 {
643 if(!$a_fields)
644 {
645 return '';
646 }
647 $in = " IN ('";
648 $in .= implode("','",$a_fields);
649 $in .= "') ";
650
651 return $in;
652 }

References $in.

Referenced by __createEducationalWhere().

+ Here is the caller graph for this function:

◆ __searchClassification()

& ilAdvancedSearch::__searchClassification ( )

Definition at line 365 of file class.ilAdvancedSearch.php.

366 {
367 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_classification ";
368
369 if(!strlen($where = $this->__createClassificationWhere()))
370 {
371 return false;
372 }
373 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
374 $query = $query.$where.$and;
375 $res = $this->db->query($query);
376 #var_dump("<pre>",$query,"<pre>");
377 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
378 {
379 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
380 }
382 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getFilter()
get object type to search in

References $query, $res, $row, ilAbstractSearch\$search_result, __createClassificationWhere(), DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchContribute()

& ilAdvancedSearch::__searchContribute ( )

Definition at line 238 of file class.ilAdvancedSearch.php.

239 {
240 global $ilDB;
241
242 if(!$this->options['lom_role'])
243 {
244 return false;
245 }
246
247 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_contribute ".
248 "WHERE role = ".$ilDB->quote($this->options['lom_role'] ,'text')." ".
249 "AND obj_type ".$this->__getInStatement($this->getFilter());
250
251 $res = $this->db->query($query);
252 #var_dump("<pre>",$query,"<pre>");
253 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
254 {
255 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
256 }
258 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchEducational()

& ilAdvancedSearch::__searchEducational ( )

Definition at line 307 of file class.ilAdvancedSearch.php.

308 {
309 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_educational ";
310
311 if(!strlen($where = $this->__createEducationalWhere()))
312 {
313 return false;
314 }
315 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
316 $query = $query.$where.$and;
317 $res = $this->db->query($query);
318 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
319 {
320 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
321 }
323 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createEducationalWhere(), DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchEntity()

& ilAdvancedSearch::__searchEntity ( )

Definition at line 260 of file class.ilAdvancedSearch.php.

261 {
262 $this->setFields(array('entity'));
263
264 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
265 $where = $this->__createEntityWhereCondition();
266 $locate = $this->__createLocateString();
267
268 $query = "SELECT rbac_id,obj_id,obj_type ".
269 $locate.
270 "FROM il_meta_entity ".
271 $where." ".$and.' ';
272
273 $res = $this->db->query($query);
274 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
275 {
276 $found = $this->__prepareFound($row);
277 if(!in_array(0,$found))
278 {
279 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
280 }
281 }
282
284 }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchFormat()

& ilAdvancedSearch::__searchFormat ( )

Definition at line 479 of file class.ilAdvancedSearch.php.

480 {
481 global $ilDB;
482
483 if(!$this->options['lom_format'])
484 {
485 return false;
486 }
487
488 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_format ".
489 "WHERE format LIKE(".$ilDB->quote($this->options['lom_format']).") ".
490 "AND obj_type ".$this->__getInStatement($this->getFilter());
491
492 $res = $this->db->query($query);
493 #var_dump("<pre>",$query,"<pre>");
494 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
495 {
496 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
497 }
499 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchGeneral()

& ilAdvancedSearch::__searchGeneral ( )

Definition at line 170 of file class.ilAdvancedSearch.php.

171 {
172 global $ilDB;
173
174 if(!$this->options['lom_coverage'] and !$this->options['lom_structure'])
175 {
176 return false;
177 }
178 if($this->options['lom_coverage'])
179 {
180 $this->setFields(array('coverage'));
181 $and = $this->__createCoverageAndCondition();
182 $locate = $this->__createLocateString();
183 }
184 if($this->options['lom_structure'])
185 {
186 $and .= ("AND general_structure = ".$ilDB->quote($this->options['lom_structure'] ,'text')." ");
187 }
188
189 $query = "SELECT rbac_id,obj_type,obj_id ".
190 $locate." ".
191 "FROM il_meta_general ".
192 "WHERE obj_type ".$this->__getInStatement($this->getFilter())." ".
193 $and;
194
195 $res = $this->db->query($query);
196 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
197 {
198 if($this->options['lom_coverage'])
199 {
200 $found = $this->__prepareFound($row);
201 if(!in_array(0,$found))
202 {
203 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
204 }
205 }
206 else
207 {
208 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
209 }
210 }
211
213 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchKeyword()

& ilAdvancedSearch::__searchKeyword (   $a_in_classification = false)

Definition at line 410 of file class.ilAdvancedSearch.php.

411 {
412 $this->setFields(array('keyword'));
413
414 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
415 if($a_in_classification)
416 {
417 $and .= " AND parent_type = 'meta_classification' ";
418 }
419 $where = $this->__createKeywordWhereCondition();
420 $locate = $this->__createLocateString();
421
422 $query = "SELECT rbac_id,obj_id,obj_type ".
423 $locate.
424 "FROM il_meta_keyword ".
425 $where." ".$and.' ';
426
427 $res = $this->db->query($query);
428 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
429 {
430 $found = $this->__prepareFound($row);
431 if(!in_array(0,$found) or !$a_in_classification)
432 {
433 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
434 }
435 }
436
438 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchLanguage()

& ilAdvancedSearch::__searchLanguage ( )

Definition at line 215 of file class.ilAdvancedSearch.php.

216 {
217 global $ilDB;
218
219 if(!$this->options['lom_language'])
220 {
221 return false;
222 }
223
224 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_language ".
225 "WHERE language = ".$ilDB->quote($this->options['lom_language'] ,'text')." ".
226 "AND obj_type ".$this->__getInStatement($this->getFilter()).' '.
227 "AND parent_type = 'meta_general'";
228
229 $res = $this->db->query($query);
230 #var_dump("<pre>",$query,"<pre>");
231 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
232 {
233 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
234 }
236 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchLifecycle()

& ilAdvancedSearch::__searchLifecycle ( )

Definition at line 439 of file class.ilAdvancedSearch.php.

440 {
441 global $ilDB;
442
443 $this->setFields(array('meta_version'));
444
445 if($this->options['lom_version'])
446 {
447 $where = $this->__createLifecycleWhereCondition();
448 $locate = $this->__createLocateString();
449 }
450 else
451 {
452 $where = "WHERE 1 = 1 ";
453 }
454 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
455
456 if($this->options['lom_status'])
457 {
458 $and .= (" AND lifecycle_status = ".$ilDB->quote($this->options['lom_status'] ,'text') ."");
459 }
460
461 $query = "SELECT rbac_id,obj_id,obj_type ".
462 $locate.
463 "FROM il_meta_lifecycle ".
464 $where." ".$and.' ';
465
466 $res = $this->db->query($query);
467 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
468 {
469 $found = $this->__prepareFound($row);
470 if(!in_array(0,$found))
471 {
472 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
473 }
474 }
475
477 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchRequirement()

& ilAdvancedSearch::__searchRequirement ( )

Definition at line 288 of file class.ilAdvancedSearch.php.

289 {
290 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_requirement ";
291
292 if(!strlen($where = $this->__createRequirementWhere()))
293 {
294 return false;
295 }
296 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
297 $query = $query.$where.$and;
298 $res = $this->db->query($query);
299 #var_dump("<pre>",$query,"<pre>");
300 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
301 {
302 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
303 }
305 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createRequirementWhere(), DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchRights()

& ilAdvancedSearch::__searchRights ( )

Definition at line 346 of file class.ilAdvancedSearch.php.

347 {
348 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_rights ";
349
350 if(!strlen($where = $this->__createRightsWhere()))
351 {
352 return false;
353 }
354 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
355 $query = $query.$where.$and;
356 $res = $this->db->query($query);
357 #var_dump("<pre>",$query,"<pre>");
358 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
359 {
360 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
361 }
363 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createRightsWhere(), DB_FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTaxon()

& ilAdvancedSearch::__searchTaxon ( )

Definition at line 384 of file class.ilAdvancedSearch.php.

385 {
386 $this->setFields(array('taxon'));
387
388 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
389 $where = $this->__createTaxonWhereCondition();
390 $locate = $this->__createLocateString();
391
392 $query = "SELECT rbac_id,obj_id,obj_type ".
393 $locate.
394 "FROM il_meta_taxon ".
395 $where." ".$and.' ';
396
397 $res = $this->db->query($query);
398 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
399 {
400 $found = $this->__prepareFound($row);
401 if(!in_array(0,$found))
402 {
403 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
404 }
405 }
406
408 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTitleDescription()

& ilAdvancedSearch::__searchTitleDescription ( )

Definition at line 147 of file class.ilAdvancedSearch.php.

148 {
149 $this->setFields(array('title','description'));
150
151 $and = ("AND type ".$this->__getInStatement($this->getFilter()));
152 $where = $this->__createTitleDescriptionWhereCondition();
153 $locate = $this->__createLocateString();
154
155 $query = "SELECT obj_id,type ".
156 $locate.
157 "FROM object_data ".
158 $where." ".$and.' '.
159 "ORDER BY obj_id DESC";
160
161 $res = $this->db->query($query);
162 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
163 {
164 $this->search_result->addEntry($row->obj_id,$row->type,$this->__prepareFound($row));
165 }
166
168 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), DB_FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTypicalAgeRange()

& ilAdvancedSearch::__searchTypicalAgeRange ( )

Definition at line 325 of file class.ilAdvancedSearch.php.

326 {
327 if(!$this->options['typ_age_1'] or !$this->options['typ_age_2'])
328 {
329 return false;
330 }
331
332 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_typical_age_range ".
333 "WHERE typical_age_range_min >= '".(int) $this->options['typ_age_1']."' ".
334 "AND typical_age_range_max <= '".(int) $this->options['typ_age_2']."'";
335
336
337 $res = $this->db->query($query);
338 #var_dump("<pre>",$query,"<pre>");
339 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
340 {
341 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
342 }
344 }

References $query, $res, $row, ilAbstractSearch\$search_result, and DB_FETCHMODE_OBJECT.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ getMode()

ilAdvancedSearch::getMode ( )

Definition at line 67 of file class.ilAdvancedSearch.php.

References $mode.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ ilAdvancedSearch()

ilAdvancedSearch::ilAdvancedSearch ( $qp_obj)

Constructor @access public.

Definition at line 52 of file class.ilAdvancedSearch.php.

53 {
54 parent::ilAbstractSearch($qp_obj);
55 }

◆ performSearch()

& ilAdvancedSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

Definition at line 77 of file class.ilAdvancedSearch.php.

78 {
79 switch($this->getMode())
80 {
81 case 'requirement':
82 return $this->__searchRequirement();
83 break;
84
85 case 'educational':
86 return $this->__searchEducational();
87 break;
88
89 case 'typical_age_range':
90 return $this->__searchTypicalAgeRange();
91 break;
92
93 case 'rights':
94 return $this->__searchRights();
95 break;
96
97 case 'classification':
98 return $this->__searchClassification();
99 break;
100
101 case 'taxon':
102 return $this->__searchTaxon();
103 break;
104
105 case 'keyword':
106 return $this->__searchKeyword();
107 break;
108
109 case 'format':
110 return $this->__searchFormat();
111 break;
112
113 case 'lifecycle':
114 return $this->__searchLifecycle();
115 break;
116
117 case 'contribute':
118 return $this->__searchContribute();
119 break;
120
121 case 'entity':
122 return $this->__searchEntity();
123 break;
124
125 case 'general':
126 return $this->__searchGeneral();
127 break;
128
129 case 'keyword_all':
130 return $this->__searchKeyword(false);
131 break;
132
133 case 'title_description':
134 return $this->__searchTitleDescription();
135 break;
136
137 case 'language':
138 return $this->__searchLanguage();
139 break;
140
141 default:
142 echo "ilMDSearch::performSearch() no mode given";
143 return false;
144 }
145 }
& __searchKeyword($a_in_classification=false)

References __searchClassification(), __searchContribute(), __searchEducational(), __searchEntity(), __searchFormat(), __searchGeneral(), __searchKeyword(), __searchLanguage(), __searchLifecycle(), __searchRequirement(), __searchRights(), __searchTaxon(), __searchTitleDescription(), __searchTypicalAgeRange(), and getMode().

+ Here is the call graph for this function:

◆ setMode()

ilAdvancedSearch::setMode (   $a_mode)

Define meta elements to search.

Parameters
arrayelements to search in. E.G array('keyword','contribute') @access public

Definition at line 63 of file class.ilAdvancedSearch.php.

64 {
65 $this->mode = $a_mode;
66 }

◆ setOptions()

ilAdvancedSearch::setOptions ( $options)

Definition at line 72 of file class.ilAdvancedSearch.php.

73 {
74 $this->options =& $options;
75 }

References $options.

Field Documentation

◆ $db

ilAdvancedSearch::$db = null

Definition at line 46 of file class.ilAdvancedSearch.php.

◆ $mode

ilAdvancedSearch::$mode = ''

Definition at line 39 of file class.ilAdvancedSearch.php.

Referenced by getMode().

◆ $query_parser

ilAdvancedSearch::$query_parser = null

Definition at line 44 of file class.ilAdvancedSearch.php.


The documentation for this class was generated from the following file: