ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDSearch Class Reference
+ Collaboration diagram for ilMDSearch:

Public Member Functions

 ilMDSearch (&$qp_obj)
 Constructor public.
 setMode ($a_mode)
 Define meta elements to search.
 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

ilMDSearch::__searchKeywordsOnly ( )

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

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

Referenced by performSearch().

{
$where = " WHERE ";
$field = " keyword ";
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
if($counter++)
{
$where .= strtoupper($this->query_parser->getCombination());
}
$where .= $field;
$where .= ("LIKE (".$ilDB->quote("%".$word."%").")");
}
$query = "SELECT * FROM il_meta_keyword".
$where.
"ORDER BY meta_keyword_id DESC";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->obj_id,$row->obj_type,$row->rbac_id);
}
return $this->search_result;
}

+ Here is the caller graph for this function:

ilMDSearch::getMode ( )

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

References $mode.

Referenced by performSearch().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilMDSearch::ilMDSearch ( $qp_obj)

Constructor public.

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

References $ilDB.

{
global $ilDB;
$this->query_parser =& $qp_obj;
$this->db =& $ilDB;
include_once 'Services/Search/classes/class.ilSearchResult.php';
$this->search_result = new ilSearchResult();
}
& ilMDSearch::performSearch ( )

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

References __searchKeywordsOnly(), and getMode().

{
switch($this->getMode())
{
case 'all':
break;
case 'keyword':
return $this->__searchKeywordsOnly();
break;
default:
echo "ilMDSearch::performSearch() no mode given";
return false;
}
}

+ Here is the call graph for this function:

ilMDSearch::setMode (   $a_mode)

Define meta elements to search.

Parameters
stringmode keyword or all public

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

{
$this->mode = $a_mode;
}

Field Documentation

ilMDSearch::$db = null

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

ilMDSearch::$mode = ''

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

Referenced by getMode().

ilMDSearch::$query_parser = null

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


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