ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 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 472 of file class.ilAdvancedSearch.php.

References $counter, and $ilDB.

Referenced by __searchClassification().

473  {
474  global $ilDB;
475 
476  $counter = 0;
477  $where = 'WHERE ';
478 
479 
480  if ($this->options['lom_purpose']) {
481  $and = $counter++ ? 'AND ' : ' ';
482  $where .= ($and . "purpose = " . $ilDB->quote($this->options['lom_purpose']) . " ");
483  }
484  return $counter ? $where : '';
485  }
$counter
global $ilDB
+ Here is the caller graph for this function:

◆ __createEducationalWhere()

ilAdvancedSearch::__createEducationalWhere ( )

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

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

Referenced by __searchEducational().

487  {
488  global $ilDB;
489 
490  $counter = 0;
491  $where = 'WHERE ';
492 
493 
494  if ($this->options['lom_interactivity']) {
495  $and = $counter++ ? 'AND ' : ' ';
496  $where .= ($and . "interactivity_type = " . $ilDB->quote($this->options['lom_interactivity'], 'text') . " ");
497  }
498  if ($this->options['lom_resource']) {
499  $and = $counter++ ? 'AND ' : ' ';
500  $where .= ($and . "learning_resource_type = " . $ilDB->quote($this->options['lom_resource'], 'text') . " ");
501  }
502  if ($this->options['lom_user_role']) {
503  $and = $counter++ ? 'AND ' : ' ';
504  $where .= ($and . "intended_end_user_role = " . $ilDB->quote($this->options['lom_user_role'], 'text') . " ");
505  }
506  if ($this->options['lom_context']) {
507  $and = $counter++ ? 'AND ' : ' ';
508  $where .= ($and . "context = " . $ilDB->quote($this->options['lom_context'], 'text') . " ");
509  }
510  if ($this->options['lom_level_start'] or $this->options['lom_level_end']) {
511  $and = $counter++ ? 'AND ' : ' ';
512 
513  $fields = $this->__getDifference(
514  $this->options['lom_level_start'],
515  $this->options['lom_level_end'],
516  array('VeryLow','Low','Medium','High','VeryHigh')
517  );
518 
519  $where .= ($and . "interactivity_level " . $this->__getInStatement($fields));
520  }
521  if ($this->options['lom_density_start'] or $this->options['lom_density_end']) {
522  $and = $counter++ ? 'AND ' : ' ';
523 
524  $fields = $this->__getDifference(
525  $this->options['lom_density_start'],
526  $this->options['lom_density_end'],
527  array('VeryLow','Low','Medium','High','VeryHigh')
528  );
529 
530  $where .= ($and . "semantic_density " . $this->__getInStatement($fields));
531  }
532  if ($this->options['lom_difficulty_start'] or $this->options['lom_difficulty_end']) {
533  $and = $counter++ ? 'AND ' : ' ';
534 
535  $fields = $this->__getDifference(
536  $this->options['lom_difficulty_start'],
537  $this->options['lom_difficulty_end'],
538  array('VeryEasy','Easy','Medium','Difficult','VeryDifficult')
539  );
540 
541  $where .= ($and . "difficulty " . $this->__getInStatement($fields));
542  }
543 
544  return $counter ? $where : '';
545  }
$counter
__getDifference($a_val1, $a_val2, $options)
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __createRequirementWhere()

ilAdvancedSearch::__createRequirementWhere ( )

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

References $counter, and $ilDB.

Referenced by __searchRequirement().

547  {
548  global $ilDB;
549 
550  $counter = 0;
551  $where = 'WHERE ';
552 
553 
554  if ($this->options['lom_operating_system']) {
555  $and = $counter++ ? 'AND ' : ' ';
556  $where .= ($and . "operating_system_name = " . $ilDB->quote($this->options['lom_operating_system']) . " ");
557  }
558  if ($this->options['lom_browser']) {
559  $and = $counter++ ? 'AND ' : ' ';
560  $where .= ($and . "browser_name = " . $ilDB->quote($this->options['lom_browser']) . " ");
561  }
562  return $counter ? $where : '';
563  }
$counter
global $ilDB
+ Here is the caller graph for this function:

◆ __createRightsWhere()

ilAdvancedSearch::__createRightsWhere ( )

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

References $counter, and $ilDB.

Referenced by __searchRights().

455  {
456  global $ilDB;
457 
458  $counter = 0;
459  $where = 'WHERE ';
460 
461 
462  if ($this->options['lom_costs']) {
463  $and = $counter++ ? 'AND ' : ' ';
464  $where .= ($and . "costs = " . $ilDB->quote($this->options['lom_costs'], 'text') . " ");
465  }
466  if ($this->options['lom_copyright']) {
467  $and = $counter++ ? 'AND ' : ' ';
468  $where .= ($and . "cpr_and_or = " . $ilDB->quote($this->options['lom_copyright'], 'text') . " ");
469  }
470  return $counter ? $where : '';
471  }
$counter
global $ilDB
+ Here is the caller graph for this function:

◆ __getDifference()

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

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

References $counter, $options, and array.

Referenced by __createEducationalWhere().

566  {
567  $a_val2 = $a_val2 ? $a_val2 : count($options);
568  // Call again if a > b
569  if ($a_val1 > $a_val2) {
570  return $this->__getDifference($a_val2, $a_val1, $options);
571  }
572 
573  $counter = 0;
574  foreach ($options as $option) {
575  if ($a_val1 > ++$counter) {
576  continue;
577  }
578  if ($a_val2 < $counter) {
579  break;
580  }
581  $fields[] = $option;
582  }
583  return $fields ? $fields : array();
584  }
$counter
__getDifference($a_val1, $a_val2, $options)
Create styles array
The data for the language used.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the caller graph for this function:

◆ __getInStatement()

ilAdvancedSearch::__getInStatement (   $a_fields)

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

References $in.

Referenced by __createEducationalWhere(), __searchClassification(), __searchContribute(), __searchEducational(), __searchEntity(), __searchFormat(), __searchGeneral(), __searchKeyword(), __searchLanguage(), __searchLifecycle(), __searchRequirement(), __searchRights(), __searchTaxon(), and __searchTitleDescription().

587  {
588  if (!$a_fields) {
589  return '';
590  }
591  $in = " IN ('";
592  $in .= implode("','", $a_fields);
593  $in .= "') ";
594 
595  return $in;
596  }
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
+ Here is the caller graph for this function:

◆ __searchClassification()

& ilAdvancedSearch::__searchClassification ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, __createClassificationWhere(), __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

333  {
334  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_classification ";
335 
336  if (!strlen($where = $this->__createClassificationWhere())) {
337  return false;
338  }
339  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
340  $query = $query . $where . $and;
341  $res = $this->db->query($query);
342  #var_dump("<pre>",$query,"<pre>");
343  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
344  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
345  }
346  return $this->search_result;
347  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchContribute()

& ilAdvancedSearch::__searchContribute ( )

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

218  {
219  global $ilDB;
220 
221  if (!$this->options['lom_role']) {
222  return false;
223  }
224 
225  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_contribute " .
226  "WHERE role = " . $ilDB->quote($this->options['lom_role'], 'text') . " " .
227  "AND obj_type " . $this->__getInStatement($this->getFilter());
228 
229  $res = $this->db->query($query);
230  #var_dump("<pre>",$query,"<pre>");
231  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
232  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
233  }
234  return $this->search_result;
235  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchEducational()

& ilAdvancedSearch::__searchEducational ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, __createEducationalWhere(), __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

281  {
282  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_educational ";
283 
284  if (!strlen($where = $this->__createEducationalWhere())) {
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  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
291  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
292  }
293  return $this->search_result;
294  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchEntity()

& ilAdvancedSearch::__searchEntity ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), ilAbstractSearch\__prepareFound(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

238  {
239  $this->setFields(array('entity'));
240 
241  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
242  $where = $this->__createEntityWhereCondition();
243  $locate = $this->__createLocateString();
244 
245  $query = "SELECT rbac_id,obj_id,obj_type " .
246  $locate .
247  "FROM il_meta_entity " .
248  $where . " " . $and . ' ';
249 
250  $res = $this->db->query($query);
251  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
252  $found = $this->__prepareFound($row);
253  if (!in_array(0, $found)) {
254  $this->search_result->addEntry($row->rbac_id, $row->obj_type, $found, $row->obj_id);
255  }
256  }
257 
258  return $this->search_result;
259  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchFormat()

& ilAdvancedSearch::__searchFormat ( )

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

434  {
435  global $ilDB;
436 
437  if (!$this->options['lom_format']) {
438  return false;
439  }
440 
441  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_format " .
442  "WHERE format LIKE(" . $ilDB->quote($this->options['lom_format']) . ") " .
443  "AND obj_type " . $this->__getInStatement($this->getFilter());
444 
445  $res = $this->db->query($query);
446  #var_dump("<pre>",$query,"<pre>");
447  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
448  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
449  }
450  return $this->search_result;
451  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchGeneral()

& ilAdvancedSearch::__searchGeneral ( )

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), ilAbstractSearch\__prepareFound(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

160  {
161  global $ilDB;
162 
163  if (!$this->options['lom_coverage'] and !$this->options['lom_structure']) {
164  return false;
165  }
166  if ($this->options['lom_coverage']) {
167  $this->setFields(array('coverage'));
168  $and = $this->__createCoverageAndCondition();
169  $locate = $this->__createLocateString();
170  }
171  if ($this->options['lom_structure']) {
172  $and .= ("AND general_structure = " . $ilDB->quote($this->options['lom_structure'], 'text') . " ");
173  }
174 
175  $query = "SELECT rbac_id,obj_type,obj_id " .
176  $locate . " " .
177  "FROM il_meta_general " .
178  "WHERE obj_type " . $this->__getInStatement($this->getFilter()) . " " .
179  $and;
180 
181  $res = $this->db->query($query);
182  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
183  if ($this->options['lom_coverage']) {
184  $found = $this->__prepareFound($row);
185  if (!in_array(0, $found)) {
186  $this->search_result->addEntry($row->rbac_id, $row->obj_type, $found, $row->obj_id);
187  }
188  } else {
189  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
190  }
191  }
192 
193  return $this->search_result;
194  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ 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 373 of file class.ilAdvancedSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), ilAbstractSearch\__prepareFound(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

374  {
375  $this->setFields(array('keyword'));
376 
377  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
378  if ($a_in_classification) {
379  $and .= " AND parent_type = 'meta_classification' ";
380  }
381  $where = $this->__createKeywordWhereCondition();
382  $locate = $this->__createLocateString();
383 
384  $query = "SELECT rbac_id,obj_id,obj_type " .
385  $locate .
386  "FROM il_meta_keyword " .
387  $where . " " . $and . ' ';
388 
389  $res = $this->db->query($query);
390  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
391  $found = $this->__prepareFound($row);
392  if (!in_array(0, $found) or !$a_in_classification) {
393  $this->search_result->addEntry($row->rbac_id, $row->obj_type, $found, $row->obj_id);
394  }
395  }
396 
397  return $this->search_result;
398  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchLanguage()

& ilAdvancedSearch::__searchLanguage ( )

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

197  {
198  global $ilDB;
199 
200  if (!$this->options['lom_language']) {
201  return false;
202  }
203 
204  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_language " .
205  "WHERE language = " . $ilDB->quote($this->options['lom_language'], 'text') . " " .
206  "AND obj_type " . $this->__getInStatement($this->getFilter()) . ' ' .
207  "AND parent_type = 'meta_general'";
208 
209  $res = $this->db->query($query);
210  #var_dump("<pre>",$query,"<pre>");
211  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
212  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
213  }
214  return $this->search_result;
215  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchLifecycle()

& ilAdvancedSearch::__searchLifecycle ( )

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

References $ilDB, $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), ilAbstractSearch\__prepareFound(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

400  {
401  global $ilDB;
402 
403  $this->setFields(array('meta_version'));
404 
405  if ($this->options['lom_version']) {
406  $where = $this->__createLifecycleWhereCondition();
407  $locate = $this->__createLocateString();
408  } else {
409  $where = "WHERE 1 = 1 ";
410  }
411  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
412 
413  if ($this->options['lom_status']) {
414  $and .= (" AND lifecycle_status = " . $ilDB->quote($this->options['lom_status'], 'text') . "");
415  }
416 
417  $query = "SELECT rbac_id,obj_id,obj_type " .
418  $locate .
419  "FROM il_meta_lifecycle " .
420  $where . " " . $and . ' ';
421 
422  $res = $this->db->query($query);
423  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
424  $found = $this->__prepareFound($row);
425  if (!in_array(0, $found)) {
426  $this->search_result->addEntry($row->rbac_id, $row->obj_type, $found, $row->obj_id);
427  }
428  }
429 
430  return $this->search_result;
431  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchRequirement()

& ilAdvancedSearch::__searchRequirement ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, __createRequirementWhere(), __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

264  {
265  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_requirement ";
266 
267  if (!strlen($where = $this->__createRequirementWhere())) {
268  return false;
269  }
270  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
271  $query = $query . $where . $and;
272  $res = $this->db->query($query);
273  #var_dump("<pre>",$query,"<pre>");
274  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
275  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
276  }
277  return $this->search_result;
278  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchRights()

& ilAdvancedSearch::__searchRights ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, __createRightsWhere(), __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\getFilter().

Referenced by performSearch().

316  {
317  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_rights ";
318 
319  if (!strlen($where = $this->__createRightsWhere())) {
320  return false;
321  }
322  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
323  $query = $query . $where . $and;
324  $res = $this->db->query($query);
325  #var_dump("<pre>",$query,"<pre>");
326  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
327  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
328  }
329  return $this->search_result;
330  }
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTaxon()

& ilAdvancedSearch::__searchTaxon ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), ilAbstractSearch\__prepareFound(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

350  {
351  $this->setFields(array('taxon'));
352 
353  $and = ("AND obj_type " . $this->__getInStatement($this->getFilter()));
354  $where = $this->__createTaxonWhereCondition();
355  $locate = $this->__createLocateString();
356 
357  $query = "SELECT rbac_id,obj_id,obj_type " .
358  $locate .
359  "FROM il_meta_taxon " .
360  $where . " " . $and . ' ';
361 
362  $res = $this->db->query($query);
363  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
364  $found = $this->__prepareFound($row);
365  if (!in_array(0, $found)) {
366  $this->search_result->addEntry($row->rbac_id, $row->obj_type, $found, $row->obj_id);
367  }
368  }
369 
370  return $this->search_result;
371  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTitleDescription()

& ilAdvancedSearch::__searchTitleDescription ( )

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

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), __getInStatement(), array, ilDBConstants\FETCHMODE_OBJECT, ilAbstractSearch\getFilter(), and ilAbstractSearch\setFields().

Referenced by performSearch().

138  {
139  $this->setFields(array('title','description'));
140 
141  $and = ("AND type " . $this->__getInStatement($this->getFilter()));
142  $where = $this->__createTitleDescriptionWhereCondition();
143  $locate = $this->__createLocateString();
144 
145  $query = "SELECT obj_id,type " .
146  $locate .
147  "FROM object_data " .
148  $where . " " . $and . ' ' .
149  "ORDER BY obj_id DESC";
150 
151  $res = $this->db->query($query);
152  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
153  $this->search_result->addEntry($row->obj_id, $row->type, $this->__prepareFound($row));
154  }
155 
156  return $this->search_result;
157  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchTypicalAgeRange()

& ilAdvancedSearch::__searchTypicalAgeRange ( )

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

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

Referenced by performSearch().

297  {
298  if (!$this->options['typ_age_1'] or !$this->options['typ_age_2']) {
299  return false;
300  }
301 
302  $query = "SELECT rbac_id,obj_id,obj_type FROM il_meta_typical_age_range " .
303  "WHERE typical_age_range_min >= '" . (int) $this->options['typ_age_1'] . "' " .
304  "AND typical_age_range_max <= '" . (int) $this->options['typ_age_2'] . "'";
305 
306 
307  $res = $this->db->query($query);
308  #var_dump("<pre>",$query,"<pre>");
309  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
310  $this->search_result->addEntry($row->rbac_id, $row->obj_type, array(), $row->obj_id);
311  }
312  return $this->search_result;
313  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ 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().

59  {
60  return $this->mode;
61  }
+ Here is the caller graph for this function:

◆ performSearch()

ilAdvancedSearch::performSearch ( )

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

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

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

References $options.

64  {
65  $this->options =&$options;
66  }
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20

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: