ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWikiContentSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
29{
30 public function performSearch(): ilSearchResult
31 {
32 $this->setFields(array('content'));
33
34 $in = $this->__createInStatement();
35 $where = $this->__createWhereCondition();
36 $locate = $this->__createLocateString();
37
38 $query = "SELECT page_id,parent_id,parent_type " .
39 $locate .
40 "FROM page_object, il_wiki_page " .
41 $where .
42 "AND il_wiki_page.id = page_object.page_id " .
43 $in;
44
45 $res = $this->db->query($query);
46 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
47 $this->search_result->addEntry(
48 (int) $row->parent_id,
49 $row->parent_type,
50 $this->__prepareFound($row),
51 (int) $row->page_id
52 );
53 }
55 }
56
57
58
59 // Protected can be overwritten in Like or Fulltext classes
60 public function __createInStatement(): string
61 {
62 if (!$this->getFilter() and !$this->getIdFilter()) {
63 return '';
64 }
65
66
67 $in = '';
68 if ($this->getFilter()) {
69 $type = "('";
70 $type .= implode("','", $this->getFilter());
71 $type .= "')";
72
73 $in = " AND parent_type IN " . $type . ' ';
74 }
75 if ($this->getIdFilter()) {
76 $in .= ' AND ';
77 $in .= $this->db->in('il_wiki_page.wiki_id', $this->getIdFilter(), false, 'integer');
78 }
79
80 return $in;
81 }
82}
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...
Class ilWikiContentSearch.
$res
Definition: ltiservices.php:69