ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 );
56 }
57
59 }
60
61
62
63 // Protected can be overwritten in Like or Fulltext classes
64 public function __createInStatement(): 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 }
88}
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