ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 65 of file class.ilWikiContentSearch.php.

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

Referenced by performSearch().

66  {
67  global $ilDB;
68 
69  if(!$this->getFilter() and !$this->getIdFilter())
70  {
71  return '';
72  }
73 
74 
75  $in = '';
76  if($this->getFilter())
77  {
78  $type = "('";
79  $type .= implode("','",$this->getFilter());
80  $type .= "')";
81 
82  $in = " AND parent_type IN ".$type.' ';
83 
84  }
85  if($this->getIdFilter())
86  {
87  $in .= ' AND ';
88  $in .= $ilDB->in('il_wiki_page.wiki_id',$this->getIdFilter(),false,'integer');
89  }
90 
91  return $in;
92  }
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 38 of file class.ilWikiContentSearch.php.

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

39  {
40  $this->setFields(array('content'));
41 
42  $in = $this->__createInStatement();
43  $where = $this->__createWhereCondition();
44  $locate = $this->__createLocateString();
45 
46  $query = "SELECT page_id,parent_id,parent_type ".
47  $locate.
48  "FROM page_object, il_wiki_page ".
49  $where.
50  "AND il_wiki_page.id = page_object.page_id ".
51  $in;
52 
53  $res = $this->db->query($query);
54  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
55  {
56  $this->search_result->addEntry($row->parent_id,$row->parent_type,$this->__prepareFound($row),$row->page_id);
57  }
58 
59  return $this->search_result;
60  }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
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: