ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLMContentSearch Class Reference
+ Inheritance diagram for ilLMContentSearch:
+ Collaboration diagram for ilLMContentSearch:

Public Member Functions

 performSearch ()
 
 __createInStatement ()
 
 __createAndCondition ()
 
- 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 ()
 

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

◆ __createAndCondition()

ilLMContentSearch::__createAndCondition ( )

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

97  {
98  echo "Overwrite me!";
99  }

◆ __createInStatement()

ilLMContentSearch::__createInStatement ( )

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

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

Referenced by performSearch().

74  {
75  global $ilDB;
76 
77  if (!$this->getFilter() and !$this->getIdFilter()) {
78  return '';
79  }
80 
81  $in = '';
82  if ($this->getFilter()) {
83  $type = "('";
84  $type .= implode("','", $this->getFilter());
85  $type .= "')";
86 
87  $in = " AND parent_type IN " . $type . ' ';
88  }
89  if ($this->getIdFilter()) {
90  $in .= ' AND ';
91  $in .= $ilDB->in('parent_id', $this->getIdFilter(), false, 'integer');
92  }
93  return $in;
94  }
$type
getFilter()
get object type to search in
getIdFilter()
Get Id filter.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilLMContentSearch::performSearch ( )

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

References $in, $query, $res, $row, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilGlossaryDefinition\_lookupTermId(), array, ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\setFields().

40  {
41  $this->setFields(array('content'));
42 
43  $in = $this->__createInStatement();
44  $where = $this->__createWhereCondition();
45  $locate = $this->__createLocateString();
46 
47  $query = "SELECT page_id,parent_id,parent_type " .
48  $locate .
49  "FROM page_object, lm_data " .
50  $where .
51  "AND obj_id = page_id " .
52  $in;
53 
54 
55  $res = $this->db->query($query);
56  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
57  // workaround to get term ids for definition ids (which is not the same!!!)
58  if ($row->parent_type == "gdf") {
59  // it is not a page id anymore now, it is a term id
60  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
61  $row->page_id = ilGlossaryDefinition::_lookupTermId($row->page_id);
62  }
63 
64  $this->search_result->addEntry($row->parent_id, $row->parent_type, $this->__prepareFound($row), $row->page_id);
65  }
66 
67  return $this->search_result;
68  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
static _lookupTermId($a_def_id)
Looks up term id for a definition id.
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
+ Here is the call graph for this function:

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