ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLikeUserDefinedFieldSearch Class Reference
+ Inheritance diagram for ilLikeUserDefinedFieldSearch:
+ Collaboration diagram for ilLikeUserDefinedFieldSearch:

Public Member Functions

 ilLikeUserDefinedFieldSearch (&$qp_obj)
 Constructor public.
 setFields ($a_fields)
 __createWhereCondition ()
- Public Member Functions inherited from ilUserDefinedFieldSearch
 ilUserDefinedFieldSearch (&$query_parser)
 Constructor public.
performSearch ()
- Public Member Functions inherited from ilAbstractSearch
 ilAbstractSearch (&$qp_obj)
 Constructor public.
 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)

Additional Inherited Members

- Data Fields inherited from ilAbstractSearch
 $db = null
 $query_parser = null
 $search_result = null
 $object_types = array('cat','dbk','crs','fold','grp','lm','sahs','glo','mep','htlm','exc','file','qpl','tst','svy','spl', 'icrs','icla','webr','mcst','sess','pg','st','book')

Detailed Description

Definition at line 17 of file class.ilLikeUserDefinedFieldSearch.php.

Member Function Documentation

ilLikeUserDefinedFieldSearch::__createWhereCondition ( )

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

References $ilDB, and ilAbstractSearch\getFields().

{
global $ilDB;
$fields = $this->getFields();
$field = $fields[0];
$and = " WHERE field_id = ".$ilDB->quote((int) substr($field, 2), "integer")." AND ( ";
$counter = 0;
foreach($this->query_parser->getQuotedWords() as $word)
{
if($counter++)
{
$and .= " OR ";
}
if(strpos($word,'^') === 0)
{
$and .= $ilDB->like("value", "text", substr($word,1)."%");
}
else
{
$and .= $ilDB->like("value", "text", "%".$word."%");
}
}
return $and.") ";
}

+ Here is the call graph for this function:

ilLikeUserDefinedFieldSearch::ilLikeUserDefinedFieldSearch ( $qp_obj)

Constructor public.

Definition at line 24 of file class.ilLikeUserDefinedFieldSearch.php.

References ilUserDefinedFieldSearch\ilUserDefinedFieldSearch().

+ Here is the call graph for this function:

ilLikeUserDefinedFieldSearch::setFields (   $a_fields)
Parameters
@return

Reimplemented from ilAbstractSearch.

Definition at line 34 of file class.ilLikeUserDefinedFieldSearch.php.

{
foreach($a_fields as $field)
{
$fields[] = 'f_'.$field;
}
parent::setFields($fields ? $fields : array());
}

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