ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMDSearch Class Reference
+ Collaboration diagram for ilMDSearch:

Public Member Functions

 ilMDSearch (&$qp_obj)
 Constructor @access public. More...
 
 setMode ($a_mode)
 Define meta elements to search. More...
 
 getMode ()
 
performSearch ()
 
 __searchKeywordsOnly ()
 

Data Fields

 $mode = ''
 
 $query_parser = null
 
 $db = null
 

Detailed Description

Definition at line 36 of file class.ilMDSearch.php.

Member Function Documentation

◆ __searchKeywordsOnly()

ilMDSearch::__searchKeywordsOnly ( )

Definition at line 98 of file class.ilMDSearch.php.

99 {
100 $where = " WHERE ";
101 $field = " keyword ";
102 $counter = 0;
103 foreach($this->query_parser->getQuotedWords() as $word)
104 {
105 if($counter++)
106 {
107 $where .= strtoupper($this->query_parser->getCombination());
108 }
109 $where .= $field;
110 $where .= ("LIKE (".$ilDB->quote("%".$word."%").")");
111 }
112
113 $query = "SELECT * FROM il_meta_keyword".
114 $where.
115 "ORDER BY meta_keyword_id DESC";
116
117 $res = $this->db->query($query);
118 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
119 {
120 $this->search_result->addEntry($row->obj_id,$row->obj_type,$row->rbac_id);
121 }
122
123 return $this->search_result;
124 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ getMode()

ilMDSearch::getMode ( )

Definition at line 73 of file class.ilMDSearch.php.

74 {
75 return $this->mode;
76 }

References $mode.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ ilMDSearch()

ilMDSearch::ilMDSearch ( $qp_obj)

Constructor @access public.

Definition at line 51 of file class.ilMDSearch.php.

52 {
53 global $ilDB;
54
55 $this->query_parser =& $qp_obj;
56 $this->db =& $ilDB;
57
58 include_once 'Services/Search/classes/class.ilSearchResult.php';
59
60 $this->search_result = new ilSearchResult();
61 }
global $ilDB

References $ilDB.

◆ performSearch()

& ilMDSearch::performSearch ( )

Definition at line 79 of file class.ilMDSearch.php.

80 {
81 switch($this->getMode())
82 {
83 case 'all':
84 break;
85 case 'keyword':
86 return $this->__searchKeywordsOnly();
87 break;
88
89 default:
90 echo "ilMDSearch::performSearch() no mode given";
91 return false;
92 }
93 }

References __searchKeywordsOnly(), and getMode().

+ Here is the call graph for this function:

◆ setMode()

ilMDSearch::setMode (   $a_mode)

Define meta elements to search.

Parameters
stringmode keyword or all @access public

Definition at line 69 of file class.ilMDSearch.php.

70 {
71 $this->mode = $a_mode;
72 }

Field Documentation

◆ $db

ilMDSearch::$db = null

Definition at line 45 of file class.ilMDSearch.php.

◆ $mode

ilMDSearch::$mode = ''

Definition at line 38 of file class.ilMDSearch.php.

Referenced by getMode().

◆ $query_parser

ilMDSearch::$query_parser = null

Definition at line 43 of file class.ilMDSearch.php.


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