ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 97 of file class.ilLMContentSearch.php.

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

◆ __createInStatement()

ilLMContentSearch::__createInStatement ( )

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

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

Referenced by performSearch().

73  {
74  global $DIC;
75 
76  $ilDB = $DIC['ilDB'];
77 
78  if (!$this->getFilter() and !$this->getIdFilter()) {
79  return '';
80  }
81 
82  $in = '';
83  if ($this->getFilter()) {
84  $type = "('";
85  $type .= implode("','", $this->getFilter());
86  $type .= "')";
87 
88  $in = " AND parent_type IN " . $type . ' ';
89  }
90  if ($this->getIdFilter()) {
91  $in .= ' AND ';
92  $in .= $ilDB->in('parent_id', $this->getIdFilter(), false, 'integer');
93  }
94  return $in;
95  }
$type
getFilter()
get object type to search in
getIdFilter()
Get Id filter.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
global $ilDB
$DIC
Definition: xapitoken.php:46
+ 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, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilGlossaryDefinition\_lookupTermId(), 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  $row->page_id = ilGlossaryDefinition::_lookupTermId($row->page_id);
61  }
62 
63  $this->search_result->addEntry($row->parent_id, $row->parent_type, $this->__prepareFound($row), $row->page_id);
64  }
65 
66  return $this->search_result;
67  }
__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
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: