ILIAS  release_8 Revision v8.24
ilWikiContentSearch Class Reference

Class ilWikiContentSearch. More...

+ Inheritance diagram for ilWikiContentSearch:
+ Collaboration diagram for ilWikiContentSearch:

Public Member Functions

 performSearch ()
 
 __createInStatement ()
 
- Public Member Functions inherited from ilAbstractSearch
 __construct (ilQueryParser $qp_obj)
 
 setFields (array $a_fields)
 
 getFields ()
 
 setFilter (array $a_filter)
 
 setIdFilter (array $a_id_filter)
 
 getIdFilter ()
 
 appendToFilter (string $a_type)
 
 getFilter ()
 
 __createLocateString ()
 
 __prepareFound (object $row)
 
 performSearch ()
 

Additional Inherited Members

- Protected Attributes inherited from ilAbstractSearch
ilDBInterface $db
 
ilQueryParser $query_parser
 
ilSearchResult $search_result
 
array $object_types
 

Detailed Description

Class ilWikiContentSearch.

Abstract class for wiki content.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 35 of file class.ilWikiContentSearch.php.

Member Function Documentation

◆ __createInStatement()

ilWikiContentSearch::__createInStatement ( )

Definition at line 67 of file class.ilWikiContentSearch.php.

67 : string
68 {
69 if (!$this->getFilter() and !$this->getIdFilter()) {
70 return '';
71 }
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 .= $this->db->in('il_wiki_page.wiki_id', $this->getIdFilter(), false, 'integer');
85 }
86
87 return $in;
88 }
$type

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

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilWikiContentSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

Definition at line 37 of file class.ilWikiContentSearch.php.

38 {
39 $this->setFields(array('content'));
40
41 $in = $this->__createInStatement();
42 $where = $this->__createWhereCondition();
43 $locate = $this->__createLocateString();
44
45 $query = "SELECT page_id,parent_id,parent_type " .
46 $locate .
47 "FROM page_object, il_wiki_page " .
48 $where .
49 "AND il_wiki_page.id = page_object.page_id " .
50 $in;
51
52 $res = $this->db->query($query);
53 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
54 $this->search_result->addEntry(
55 (int) $row->parent_id,
56 $row->parent_type,
57 $this->__prepareFound($row),
58 (int) $row->page_id
59 );
60 }
62 }
setFields(array $a_fields)
ilSearchResult $search_result
$res
Definition: ltiservices.php:69
$query

References $query, $res, ilAbstractSearch\$search_result, __createInStatement(), ilAbstractSearch\__createLocateString(), ilDBConstants\FETCHMODE_OBJECT, and ilAbstractSearch\setFields().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: