ILIAS  Release_3_10_x_branch Revision 61812
 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
 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

Detailed Description

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

Member Function Documentation

ilAbstractSearch::__createLocateString ( )

build locate string in case of AND search

Returns
string public

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

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

{
if($this->query_parser->getCombination() == 'or')
{
return '';
}
if(count($this->fields) > 1)
{
$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('".$word."',".$complete_str.") ");
$locate .= ("as found".$counter++." ");
}
return $locate;
}

+ Here is the caller graph for this function:

ilAbstractSearch::__prepareFound ( $row)

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

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 113 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 90 of file class.ilAbstractSearch.php.

Referenced by ilLikeUserDefinedFieldSearch\__createWhereCondition(), ilLikeUserSearch\__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::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 100 of file class.ilAbstractSearch.php.

{
if(is_array($a_filter))
{
$this->object_types = $a_filter;
}
}

Field Documentation

ilAbstractSearch::$db = null

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

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 55 of file class.ilAbstractSearch.php.

ilAbstractSearch::$search_result = null

Definition at line 50 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(), ilUserDefinedFieldSearch\performSearch(), ilWebresourceSearch\performSearch(), ilForumSearch\performSearch(), ilMediaCastSearch\performSearch(), ilExerciseSearch\performSearch(), ilGlossaryDefinitionSearch\performSearch(), ilWikiContentSearch\performSearch(), ilMediaPoolSearch\performSearch(), ilLMContentSearch\performSearch(), ilObjectSearch\performSearch(), ilShopObjectSearch\performSearch(), ilUserSearch\performSearch(), ilAdvancedMDSearch\performSearch(), and ilTestSearch\performSearch().


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