ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ($qp_obj)
 Constructor public. More...
 
 setFields ($a_fields)
 Set fields to search. More...
 
 getFields ()
 Get fields to search. More...
 
 setFilter ($a_filter)
 set object type to search in More...
 
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id. More...
 
 getIdFilter ()
 Get Id filter. More...
 
 appendToFilter ($a_type)
 Append object type to filter. More...
 
 getFilter ()
 get object type to search in More...
 
 __createLocateString ()
 build locate string in case of AND search More...
 
 __prepareFound (&$row)
 
 performSearch ()
 

Additional Inherited Members

- Data Fields inherited from ilAbstractSearch
 $db = null
 
 $query_parser = null
 
 $search_result = null
 
 $object_types
 

Detailed Description

Class ilWikiContentSearch.

Abstract class for wiki content. Should be inherited by ilFulltextWikiContentSearch

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

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

Member Function Documentation

◆ __createInStatement()

ilWikiContentSearch::__createInStatement ( )

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

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

Referenced by performSearch().

64  {
65  global $ilDB;
66 
67  if (!$this->getFilter() and !$this->getIdFilter()) {
68  return '';
69  }
70 
71 
72  $in = '';
73  if ($this->getFilter()) {
74  $type = "('";
75  $type .= implode("','", $this->getFilter());
76  $type .= "')";
77 
78  $in = " AND parent_type IN " . $type . ' ';
79  }
80  if ($this->getIdFilter()) {
81  $in .= ' AND ';
82  $in .= $ilDB->in('il_wiki_page.wiki_id', $this->getIdFilter(), false, 'integer');
83  }
84 
85  return $in;
86  }
$type
getFilter()
get object type to search in
getIdFilter()
Get Id filter.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilWikiContentSearch::performSearch ( )

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

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

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($row->parent_id, $row->parent_type, $this->__prepareFound($row), $row->page_id);
55  }
56 
57  return $this->search_result;
58  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
+ Here is the call graph for this function:

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