ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLMContentSearch Class Reference
+ Inheritance diagram for ilLMContentSearch:
+ Collaboration diagram for ilLMContentSearch:

Public Member Functions

 performSearch ()
 
 __createInStatement ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct (ilQueryParser $qp_obj)
 
 setFields (array $a_fields)
 
 getFields ()
 
 setFilter (array $a_filter)
 
 setIdFilter (array $a_id_filter)
 
 getIdFilter ()
 
 appendToFilter (string $a_type)
 
 getFilter ()
 
 __createLocateString ()
 
 __prepareFound (object $row)
 
 performSearch ()
 

Additional Inherited Members

- Protected Member Functions inherited from ilAbstractSearch
 getValidObjectTypes (ilObjectDefinition $object_definition)
 
- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types = []
 

Detailed Description

Definition at line 30 of file class.ilLMContentSearch.php.

Member Function Documentation

◆ __createInStatement()

ilLMContentSearch::__createInStatement ( )

Definition at line 64 of file class.ilLMContentSearch.php.

References $DIC, $ilDB, ilAbstractSearch\getFilter(), and ilAbstractSearch\getIdFilter().

Referenced by performSearch().

64  : string
65  {
66  global $DIC;
67 
68  $ilDB = $DIC['ilDB'];
69 
70  if (!$this->getFilter() and !$this->getIdFilter()) {
71  return '';
72  }
73 
74  $in = '';
75  if ($this->getFilter()) {
76  $type = "('";
77  $type .= implode("','", $this->getFilter());
78  $type .= "')";
79 
80  $in = " AND parent_type IN " . $type . ' ';
81  }
82  if ($this->getIdFilter()) {
83  $in .= ' AND ';
84  $in .= $ilDB->in('parent_id', $this->getIdFilter(), false, 'integer');
85  }
86  return $in;
87  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilLMContentSearch::performSearch ( )

Definition at line 32 of file class.ilLMContentSearch.php.

References $res, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilAbstractSearch\setFields().

33  {
34  $this->setFields(array('content'));
35 
36  $in = $this->__createInStatement();
37  $where = $this->__createWhereCondition();
38  $locate = $this->__createLocateString();
39 
40  $query = "SELECT page_id,parent_id,parent_type " .
41  $locate .
42  "FROM page_object, lm_data " .
43  $where .
44  "AND obj_id = page_id " .
45  $in;
46 
47 
48  $res = $this->db->query($query);
49  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
50  $this->search_result->addEntry(
51  (int) $row->parent_id,
52  (string) $row->parent_type,
53  $this->__prepareFound($row),
54  (int) $row->page_id
55  );
56  }
57 
58  return $this->search_result;
59  }
$res
Definition: ltiservices.php:66
setFields(array $a_fields)
ilSearchResult $search_result
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

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