ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMetaDataSearch Class Reference
+ Inheritance diagram for ilMetaDataSearch:
+ Collaboration diagram for ilMetaDataSearch:

Public Member Functions

 ilMetaDataSearch (&$qp_obj)
 Constructor public.
 setMode ($a_mode)
 Define meta elements to search.
 getMode ()
performSearch ()
 __createInStatement ()
 __searchContribute ()
 __searchKeywords ()
 __searchTitles ()
 __searchDescriptions ()
- Public Member Functions inherited from ilAbstractSearch
 ilAbstractSearch (&$qp_obj)
 Constructor public.
 setFields ($a_fields)
 Set fields to search.
 getFields ()
 Get fields to search.
 setFilter ($a_filter)
 set object type to search in
 setIdFilter ($a_id_filter)
 Set id filter Filters search by given object id.
 getIdFilter ()
 Get Id filter.
 appendToFilter ($a_type)
 Append object type to filter.
 getFilter ()
 get object type to search in
 __createLocateString ()
 build locate string in case of AND search
 __prepareFound (&$row)

Data Fields

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

Detailed Description

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

Member Function Documentation

ilMetaDataSearch::__createInStatement ( )

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

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

Referenced by __searchContribute(), __searchDescriptions(), __searchKeywords(), and __searchTitles().

{
if(!$this->getFilter())
{
return '';
}
else
{
$type = "('";
$type .= implode("','",$this->getFilter());
$type .= "')";
$in = " AND obj_type IN ".$type;
return $in;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMetaDataSearch::__searchContribute ( )

Definition at line 115 of file class.ilMetaDataSearch.php.

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

Referenced by performSearch().

{
$this->setFields(array('entity'));
$where = $this->__createContributeWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT rbac_id,obj_id,obj_type ".
$locate.
"FROM il_meta_entity ".
$where." ".$in.' ';
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->rbac_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMetaDataSearch::__searchDescriptions ( )

Definition at line 180 of file class.ilMetaDataSearch.php.

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

Referenced by performSearch().

{
$this->setFields(array('description'));
$where = $this->__createDescriptionWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT rbac_id,obj_id,obj_type ".
$locate.
"FROM il_meta_description ".
$where." ".$in.' ';
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->rbac_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMetaDataSearch::__searchKeywords ( )

Definition at line 138 of file class.ilMetaDataSearch.php.

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

Referenced by performSearch().

{
$this->setFields(array('keyword'));
$where = $this->__createKeywordWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT rbac_id,obj_id,obj_type ".
$locate.
"FROM il_meta_keyword ".
$where." ".$in.' ';
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->rbac_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMetaDataSearch::__searchTitles ( )

Definition at line 159 of file class.ilMetaDataSearch.php.

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

Referenced by performSearch().

{
$this->setFields(array('title'));
$where = $this->__createTitleWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT rbac_id,obj_id,obj_type ".
$locate.
"FROM il_meta_general ".
$where." ".$in.' ';
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->rbac_id,$row->obj_type,$this->__prepareFound($row),$row->obj_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMetaDataSearch::getMode ( )

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

References $mode.

Referenced by performSearch().

{
return $this->mode;
}

+ Here is the caller graph for this function:

ilMetaDataSearch::ilMetaDataSearch ( $qp_obj)

Constructor public.

Definition at line 52 of file class.ilMetaDataSearch.php.

References ilAbstractSearch\ilAbstractSearch().

Referenced by ilLikeMetaDataSearch\ilLikeMetaDataSearch().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilMetaDataSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

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

References __searchContribute(), __searchDescriptions(), __searchKeywords(), __searchTitles(), and getMode().

{
switch($this->getMode())
{
case 'keyword':
return $this->__searchKeywords();
case 'contribute':
return $this->__searchContribute();
case 'title':
return $this->__searchTitles();
case 'description':
return $this->__searchDescriptions();
default:
echo "ilMDSearch::performSearch() no mode given";
return false;
}
}

+ Here is the call graph for this function:

ilMetaDataSearch::setMode (   $a_mode)

Define meta elements to search.

Parameters
arrayelements to search in. E.G array('keyword','contribute') public

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

{
$this->mode = $a_mode;
}

Field Documentation

ilMetaDataSearch::$db = null

Definition at line 46 of file class.ilMetaDataSearch.php.

ilMetaDataSearch::$mode = ''

Definition at line 39 of file class.ilMetaDataSearch.php.

Referenced by getMode().

ilMetaDataSearch::$query_parser = null

Definition at line 44 of file class.ilMetaDataSearch.php.


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