ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilLMContentSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
31{
32 public function performSearch(): ilSearchResult
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 'pg'
56 );
57 }
58
60 }
61
62
63
64 // Protected can be overwritten in Like or Fulltext classes
65 public function __createInStatement(): string
66 {
67 global $DIC;
68
69 $ilDB = $DIC['ilDB'];
70
71 if (!$this->getFilter() and !$this->getIdFilter()) {
72 return '';
73 }
74
75 $in = '';
76 if ($this->getFilter()) {
77 $type = "('";
78 $type .= implode("','", $this->getFilter());
79 $type .= "')";
80
81 $in = " AND parent_type IN " . $type . ' ';
82 }
83 if ($this->getIdFilter()) {
84 $in .= ' AND ';
85 $in .= $ilDB->in('parent_id', $this->getIdFilter(), false, 'integer');
86 }
87 return $in;
88 }
89}
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...
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26