ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 'wpg'
53 );
54 }
56 }
57
58
59
60 // Protected can be overwritten in Like or Fulltext classes
61 public function __createInStatement(): string
62 {
63 if (!$this->getFilter() and !$this->getIdFilter()) {
64 return '';
65 }
66
67
68 $in = '';
69 if ($this->getFilter()) {
70 $type = "('";
71 $type .= implode("','", $this->getFilter());
72 $type .= "')";
73
74 $in = " AND parent_type IN " . $type . ' ';
75 }
76 if ($this->getIdFilter()) {
77 $in .= ' AND ';
78 $in .= $this->db->in('il_wiki_page.wiki_id', $this->getIdFilter(), false, 'integer');
79 }
80
81 return $in;
82 }
83}
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