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

Public Member Functions

 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)
performSearch ()

Data Fields

 $db = null
 $query_parser = null
 $search_result = null
 $object_types

Private Attributes

 $id_filter = array()

Detailed Description

Definition at line 16 of file class.ilAbstractSearch.php.

Member Function Documentation

ilAbstractSearch::__createLocateString ( )

build locate string in case of AND search

Returns
string public

Reimplemented in ilShopMetaDataSearch, and ilShopObjectSearch.

Definition at line 144 of file class.ilAbstractSearch.php.

References $ilDB.

Referenced by ilMetaDataSearch\__searchContribute(), ilMetaDataSearch\__searchDescriptions(), ilAdvancedSearch\__searchEntity(), ilAdvancedSearch\__searchGeneral(), ilAdvancedSearch\__searchKeyword(), ilMetaDataSearch\__searchKeywords(), ilAdvancedSearch\__searchLifecycle(), ilTestSearch\__searchSurveyIntroduction(), ilTestSearch\__searchSurveyTitle(), ilAdvancedSearch\__searchTaxon(), ilTestSearch\__searchTestIntroduction(), ilTestSearch\__searchTestTitle(), ilAdvancedSearch\__searchTitleDescription(), ilMetaDataSearch\__searchTitles(), ilMediaPoolSearch\performKeywordSearch(), ilUserDefinedFieldSearch\performSearch(), ilMediaPoolSearch\performSearch(), ilWebresourceSearch\performSearch(), ilExerciseSearch\performSearch(), ilForumSearch\performSearch(), ilGlossaryDefinitionSearch\performSearch(), ilMediaCastSearch\performSearch(), ilWikiContentSearch\performSearch(), ilLMContentSearch\performSearch(), ilObjectSearch\performSearch(), ilUserSearch\performSearch(), and ilAdvancedMDSearch\performSearch().

{
global $ilDB;
if($this->query_parser->getCombination() == 'or')
{
return '';
}
if(count($this->fields) > 1)
{
foreach($this->fields as $field)
{
$tmp_fields[] = array($field,'text');
}
$complete_str = $ilDB->concat($tmp_fields);
/*
$complete_str = 'CONCAT(';
$complete_str .= implode(',',$this->fields);
$complete_str .= ')';
*/
}
else
{
$complete_str = $this->fields[0];
}
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
$locate .= ',';
$locate .= $ilDB->locate($ilDB->quote($word,'text'),$complete_str);
$locate .= (' found'.$counter++);
$locate .= ' ';
#$locate .= (", LOCATE('".$word."',".$complete_str.") ");
#$locate .= ("as found".$counter++." ");
}
return $locate;
}

+ Here is the caller graph for this function:

ilAbstractSearch::__prepareFound ( $row)

Reimplemented in ilShopMetaDataSearch, and ilShopObjectSearch.

Definition at line 185 of file class.ilAbstractSearch.php.

References $row.

Referenced by ilAdvancedSearch\__searchEntity(), ilAdvancedSearch\__searchGeneral(), ilAdvancedSearch\__searchKeyword(), ilAdvancedSearch\__searchLifecycle(), and ilAdvancedSearch\__searchTaxon().

{
if($this->query_parser->getCombination() == 'or')
{
return array();
}
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
$res_found = "found".$counter++;
$found[] = $row->$res_found;
}
return $found ? $found : array();
}

+ Here is the caller graph for this function:

ilAbstractSearch::appendToFilter (   $a_type)

Append object type to filter.

Parameters
stringobj_type e.g. 'role' public

Definition at line 114 of file class.ilAbstractSearch.php.

{
if(is_array($this->object_types))
{
if(in_array($a_type,$this->object_types))
{
return false;
}
}
$this->object_types[] = $a_type;
return true;
}
ilAbstractSearch::getFields ( )

Get fields to search.

Returns
array array of search fields. E.g. array(title,description) public

Definition at line 72 of file class.ilAbstractSearch.php.

Referenced by ilLikeUserDefinedFieldSearch\__createWhereCondition(), ilLikeUserSearch\__createWhereCondition(), ilLikeTestSearch\__createWhereCondition(), ilTestSearch\__searchSurveyIntroduction(), ilTestSearch\__searchSurveyTitle(), ilTestSearch\__searchTestIntroduction(), and ilTestSearch\__searchTestTitle().

{
return $this->fields ? $this->fields : array();
}

+ Here is the caller graph for this function:

ilAbstractSearch::getIdFilter ( )

Get Id filter.

Returns

Definition at line 104 of file class.ilAbstractSearch.php.

References $id_filter.

Referenced by ilObjectSearch\__createInStatement().

{
return (array) $this->id_filter;
}

+ Here is the caller graph for this function:

ilAbstractSearch::setFilter (   $a_filter)

set object type to search in

Parameters
arrayArray of object types (e.g array('lm','st','pg','dbk')) public

Definition at line 82 of file class.ilAbstractSearch.php.

{
if(is_array($a_filter))
{
$this->object_types = $a_filter;
}
}
ilAbstractSearch::setIdFilter (   $a_id_filter)

Set id filter Filters search by given object id.

Returns

Definition at line 95 of file class.ilAbstractSearch.php.

{
$this->id_filter = $a_id_filter;
}

Field Documentation

ilAbstractSearch::$db = null

Definition at line 21 of file class.ilAbstractSearch.php.

ilAbstractSearch::$id_filter = array()
private

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

Referenced by getIdFilter().

ilAbstractSearch::$object_types
Initial value:
array('cat','dbk','crs','fold','frm','grp','lm','sahs','glo','mep','htlm','exc','file','qpl','tst','svy','spl',
'chat','icrs','icla','webr','mcst','sess','pg','st','wiki')

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

ilAbstractSearch::$search_result = null

Definition at line 30 of file class.ilAbstractSearch.php.

Referenced by ilAdvancedSearch\__searchClassification(), ilShopMetaDataSearch\__searchContribute(), ilMetaDataSearch\__searchContribute(), ilAdvancedSearch\__searchContribute(), ilMetaDataSearch\__searchDescriptions(), ilShopMetaDataSearch\__searchDescriptions(), ilAdvancedSearch\__searchEducational(), ilAdvancedSearch\__searchEntity(), ilAdvancedSearch\__searchFormat(), ilAdvancedSearch\__searchGeneral(), ilAdvancedSearch\__searchKeyword(), ilMetaDataSearch\__searchKeywords(), ilShopMetaDataSearch\__searchKeywords(), ilAdvancedSearch\__searchLanguage(), ilAdvancedSearch\__searchLifecycle(), ilAdvancedSearch\__searchRequirement(), ilAdvancedSearch\__searchRights(), ilTestSearch\__searchSurveyIntroduction(), ilTestSearch\__searchSurveyTitle(), ilAdvancedSearch\__searchTaxon(), ilTestSearch\__searchTestIntroduction(), ilTestSearch\__searchTestTitle(), ilAdvancedSearch\__searchTitleDescription(), ilMetaDataSearch\__searchTitles(), ilShopMetaDataSearch\__searchTitles(), ilAdvancedSearch\__searchTypicalAgeRange(), ilMediaPoolSearch\performKeywordSearch(), ilUserDefinedFieldSearch\performSearch(), ilMediaPoolSearch\performSearch(), ilShopObjectSearch\performSearch(), ilForumSearch\performSearch(), ilExerciseSearch\performSearch(), ilWebresourceSearch\performSearch(), ilMediaCastSearch\performSearch(), ilGlossaryDefinitionSearch\performSearch(), ilWikiContentSearch\performSearch(), ilLMContentSearch\performSearch(), ilObjectSearch\performSearch(), ilUserSearch\performSearch(), ilAdvancedMDSearch\performSearch(), and ilTestSearch\performSearch().


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