ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilAdvancedSearch Class Reference
+ Inheritance diagram for ilAdvancedSearch:
+ Collaboration diagram for ilAdvancedSearch:

Public Member Functions

 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
 __construct ($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 513 of file class.ilAdvancedSearch.php.

514 {
515 global $ilDB;
516
517 $counter = 0;
518 $where = 'WHERE ';
519
520
521 if($this->options['lom_purpose'])
522 {
523 $and = $counter++ ? 'AND ' : ' ';
524 $where .= ($and."purpose = ".$ilDB->quote($this->options['lom_purpose'])." ");
525 }
526 return $counter ? $where : '';
527 }
$counter
global $ilDB

References $counter, and $ilDB.

Referenced by __searchClassification().

+ Here is the caller graph for this function:

◆ __createEducationalWhere()

ilAdvancedSearch::__createEducationalWhere ( )

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

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

References $counter, $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 586 of file class.ilAdvancedSearch.php.

587 {
588 global $ilDB;
589
590 $counter = 0;
591 $where = 'WHERE ';
592
593
594 if($this->options['lom_operating_system'])
595 {
596 $and = $counter++ ? 'AND ' : ' ';
597 $where .= ($and."operating_system_name = ".$ilDB->quote($this->options['lom_operating_system'])." ");
598 }
599 if($this->options['lom_browser'])
600 {
601 $and = $counter++ ? 'AND ' : ' ';
602 $where .= ($and."browser_name = ".$ilDB->quote($this->options['lom_browser'])." ");
603 }
604 return $counter ? $where : '';
605 }

References $counter, and $ilDB.

Referenced by __searchRequirement().

+ Here is the caller graph for this function:

◆ __createRightsWhere()

ilAdvancedSearch::__createRightsWhere ( )

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

494 {
495 global $ilDB;
496
497 $counter = 0;
498 $where = 'WHERE ';
499
500
501 if($this->options['lom_costs'])
502 {
503 $and = $counter++ ? 'AND ' : ' ';
504 $where .= ($and."costs = ".$ilDB->quote($this->options['lom_costs'] ,'text')." ");
505 }
506 if($this->options['lom_copyright'])
507 {
508 $and = $counter++ ? 'AND ' : ' ';
509 $where .= ($and."cpr_and_or = ".$ilDB->quote($this->options['lom_copyright'] ,'text')." ");
510 }
511 return $counter ? $where : '';
512 }

References $counter, and $ilDB.

Referenced by __searchRights().

+ Here is the caller graph for this function:

◆ __getDifference()

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

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

608 {
609 $a_val2 = $a_val2 ? $a_val2 : count($options);
610 // Call again if a > b
611 if($a_val1 > $a_val2)
612 {
613 return $this->__getDifference($a_val2,$a_val1,$options);
614 }
615
616 $counter = 0;
617 foreach($options as $option)
618 {
619 if($a_val1 > ++$counter)
620 {
621 continue;
622 }
623 if($a_val2 < $counter)
624 {
625 break;
626 }
627 $fields[] = $option;
628 }
629 return $fields ? $fields : array();
630 }
if(!is_array($argv)) $options

References $counter, $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 632 of file class.ilAdvancedSearch.php.

633 {
634 if(!$a_fields)
635 {
636 return '';
637 }
638 $in = " IN ('";
639 $in .= implode("','",$a_fields);
640 $in .= "') ";
641
642 return $in;
643 }
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37

References $in.

Referenced by __createEducationalWhere().

+ Here is the caller graph for this function:

◆ __searchClassification()

& ilAdvancedSearch::__searchClassification ( )

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

357 {
358 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_classification ";
359
360 if(!strlen($where = $this->__createClassificationWhere()))
361 {
362 return false;
363 }
364 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
365 $query = $query.$where.$and;
366 $res = $this->db->query($query);
367 #var_dump("<pre>",$query,"<pre>");
368 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
369 {
370 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
371 }
373 }
getFilter()
get object type to search in

References $query, $res, $row, ilAbstractSearch\$search_result, __createClassificationWhere(), ilDBConstants\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 229 of file class.ilAdvancedSearch.php.

230 {
231 global $ilDB;
232
233 if(!$this->options['lom_role'])
234 {
235 return false;
236 }
237
238 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_contribute ".
239 "WHERE role = ".$ilDB->quote($this->options['lom_role'] ,'text')." ".
240 "AND obj_type ".$this->__getInStatement($this->getFilter());
241
242 $res = $this->db->query($query);
243 #var_dump("<pre>",$query,"<pre>");
244 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
245 {
246 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
247 }
249 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilDBConstants\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 298 of file class.ilAdvancedSearch.php.

299 {
300 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_educational ";
301
302 if(!strlen($where = $this->__createEducationalWhere()))
303 {
304 return false;
305 }
306 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
307 $query = $query.$where.$and;
308 $res = $this->db->query($query);
309 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
310 {
311 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
312 }
314 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createEducationalWhere(), ilDBConstants\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 251 of file class.ilAdvancedSearch.php.

252 {
253 $this->setFields(array('entity'));
254
255 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
256 $where = $this->__createEntityWhereCondition();
257 $locate = $this->__createLocateString();
258
259 $query = "SELECT rbac_id,obj_id,obj_type ".
260 $locate.
261 "FROM il_meta_entity ".
262 $where." ".$and.' ';
263
264 $res = $this->db->query($query);
265 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
266 {
267 $found = $this->__prepareFound($row);
268 if(!in_array(0,$found))
269 {
270 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
271 }
272 }
273
275 }
__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(), ilDBConstants\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 470 of file class.ilAdvancedSearch.php.

471 {
472 global $ilDB;
473
474 if(!$this->options['lom_format'])
475 {
476 return false;
477 }
478
479 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_format ".
480 "WHERE format LIKE(".$ilDB->quote($this->options['lom_format']).") ".
481 "AND obj_type ".$this->__getInStatement($this->getFilter());
482
483 $res = $this->db->query($query);
484 #var_dump("<pre>",$query,"<pre>");
485 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
486 {
487 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
488 }
490 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilDBConstants\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 161 of file class.ilAdvancedSearch.php.

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), ilDBConstants\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 401 of file class.ilAdvancedSearch.php.

402 {
403 $this->setFields(array('keyword'));
404
405 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
406 if($a_in_classification)
407 {
408 $and .= " AND parent_type = 'meta_classification' ";
409 }
410 $where = $this->__createKeywordWhereCondition();
411 $locate = $this->__createLocateString();
412
413 $query = "SELECT rbac_id,obj_id,obj_type ".
414 $locate.
415 "FROM il_meta_keyword ".
416 $where." ".$and.' ';
417
418 $res = $this->db->query($query);
419 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
420 {
421 $found = $this->__prepareFound($row);
422 if(!in_array(0,$found) or !$a_in_classification)
423 {
424 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
425 }
426 }
427
429 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), ilDBConstants\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 206 of file class.ilAdvancedSearch.php.

207 {
208 global $ilDB;
209
210 if(!$this->options['lom_language'])
211 {
212 return false;
213 }
214
215 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_language ".
216 "WHERE language = ".$ilDB->quote($this->options['lom_language'] ,'text')." ".
217 "AND obj_type ".$this->__getInStatement($this->getFilter()).' '.
218 "AND parent_type = 'meta_general'";
219
220 $res = $this->db->query($query);
221 #var_dump("<pre>",$query,"<pre>");
222 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
223 {
224 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
225 }
227 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilDBConstants\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 430 of file class.ilAdvancedSearch.php.

431 {
432 global $ilDB;
433
434 $this->setFields(array('meta_version'));
435
436 if($this->options['lom_version'])
437 {
438 $where = $this->__createLifecycleWhereCondition();
439 $locate = $this->__createLocateString();
440 }
441 else
442 {
443 $where = "WHERE 1 = 1 ";
444 }
445 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
446
447 if($this->options['lom_status'])
448 {
449 $and .= (" AND lifecycle_status = ".$ilDB->quote($this->options['lom_status'] ,'text') ."");
450 }
451
452 $query = "SELECT rbac_id,obj_id,obj_type ".
453 $locate.
454 "FROM il_meta_lifecycle ".
455 $where." ".$and.' ';
456
457 $res = $this->db->query($query);
458 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
459 {
460 $found = $this->__prepareFound($row);
461 if(!in_array(0,$found))
462 {
463 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
464 }
465 }
466
468 }

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), ilDBConstants\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 279 of file class.ilAdvancedSearch.php.

280 {
281 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_requirement ";
282
283 if(!strlen($where = $this->__createRequirementWhere()))
284 {
285 return false;
286 }
287 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
288 $query = $query.$where.$and;
289 $res = $this->db->query($query);
290 #var_dump("<pre>",$query,"<pre>");
291 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
292 {
293 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
294 }
296 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createRequirementWhere(), ilDBConstants\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 337 of file class.ilAdvancedSearch.php.

338 {
339 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_rights ";
340
341 if(!strlen($where = $this->__createRightsWhere()))
342 {
343 return false;
344 }
345 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
346 $query = $query.$where.$and;
347 $res = $this->db->query($query);
348 #var_dump("<pre>",$query,"<pre>");
349 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
350 {
351 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
352 }
354 }

References $query, $res, $row, ilAbstractSearch\$search_result, __createRightsWhere(), ilDBConstants\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 375 of file class.ilAdvancedSearch.php.

376 {
377 $this->setFields(array('taxon'));
378
379 $and = ("AND obj_type ".$this->__getInStatement($this->getFilter()));
380 $where = $this->__createTaxonWhereCondition();
381 $locate = $this->__createLocateString();
382
383 $query = "SELECT rbac_id,obj_id,obj_type ".
384 $locate.
385 "FROM il_meta_taxon ".
386 $where." ".$and.' ';
387
388 $res = $this->db->query($query);
389 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
390 {
391 $found = $this->__prepareFound($row);
392 if(!in_array(0,$found))
393 {
394 $this->search_result->addEntry($row->rbac_id,$row->obj_type,$found,$row->obj_id);
395 }
396 }
397
399 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilAbstractSearch\__prepareFound(), ilDBConstants\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 138 of file class.ilAdvancedSearch.php.

139 {
140 $this->setFields(array('title','description'));
141
142 $and = ("AND type ".$this->__getInStatement($this->getFilter()));
143 $where = $this->__createTitleDescriptionWhereCondition();
144 $locate = $this->__createLocateString();
145
146 $query = "SELECT obj_id,type ".
147 $locate.
148 "FROM object_data ".
149 $where." ".$and.' '.
150 "ORDER BY obj_id DESC";
151
152 $res = $this->db->query($query);
153 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
154 {
155 $this->search_result->addEntry($row->obj_id,$row->type,$this->__prepareFound($row));
156 }
157
159 }

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), ilDBConstants\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 316 of file class.ilAdvancedSearch.php.

317 {
318 if(!$this->options['typ_age_1'] or !$this->options['typ_age_2'])
319 {
320 return false;
321 }
322
323 $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_typical_age_range ".
324 "WHERE typical_age_range_min >= '".(int) $this->options['typ_age_1']."' ".
325 "AND typical_age_range_max <= '".(int) $this->options['typ_age_2']."'";
326
327
328 $res = $this->db->query($query);
329 #var_dump("<pre>",$query,"<pre>");
330 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
331 {
332 $this->search_result->addEntry($row->rbac_id,$row->obj_type,array(),$row->obj_id);
333 }
335 }

References $query, $res, $row, ilAbstractSearch\$search_result, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ getMode()

ilAdvancedSearch::getMode ( )

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

References $mode.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ performSearch()

& ilAdvancedSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

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

69 {
70 switch($this->getMode())
71 {
72 case 'requirement':
73 return $this->__searchRequirement();
74 break;
75
76 case 'educational':
77 return $this->__searchEducational();
78 break;
79
80 case 'typical_age_range':
81 return $this->__searchTypicalAgeRange();
82 break;
83
84 case 'rights':
85 return $this->__searchRights();
86 break;
87
88 case 'classification':
89 return $this->__searchClassification();
90 break;
91
92 case 'taxon':
93 return $this->__searchTaxon();
94 break;
95
96 case 'keyword':
97 return $this->__searchKeyword();
98 break;
99
100 case 'format':
101 return $this->__searchFormat();
102 break;
103
104 case 'lifecycle':
105 return $this->__searchLifecycle();
106 break;
107
108 case 'contribute':
109 return $this->__searchContribute();
110 break;
111
112 case 'entity':
113 return $this->__searchEntity();
114 break;
115
116 case 'general':
117 return $this->__searchGeneral();
118 break;
119
120 case 'keyword_all':
121 return $this->__searchKeyword(false);
122 break;
123
124 case 'title_description':
125 return $this->__searchTitleDescription();
126 break;
127
128 case 'language':
129 return $this->__searchLanguage();
130 break;
131
132 default:
133 echo "ilMDSearch::performSearch() no mode given";
134 return false;
135 }
136 }
& __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 54 of file class.ilAdvancedSearch.php.

55 {
56 $this->mode = $a_mode;
57 }

◆ setOptions()

ilAdvancedSearch::setOptions ( $options)

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

64 {
65 $this->options =& $options;
66 }

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: