ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMDSearch Class Reference
+ Inheritance diagram for ilAdvancedMDSearch:
+ Collaboration diagram for ilAdvancedMDSearch:

Public Member Functions

 __construct ($query_parser)
 Constructor.
 setDefinition ($a_def)
 set Definition
 getDefinition ()
 get definition
 performSearch ()
 perform search
 setTimeRange ($start, $end)
 set time range
- 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)

Protected Attributes

 $definition

Additional Inherited Members

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

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

ilAdvancedMDSearch::__construct (   $query_parser)

Constructor.

public

Parameters
objquery parser

Reimplemented in ilAdvancedMDLikeSearch.

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

References ilAbstractSearch\$query_parser.

Member Function Documentation

ilAdvancedMDSearch::getDefinition ( )

get definition

public

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

References $definition.

Referenced by performSearch().

{
}

+ Here is the caller graph for this function:

ilAdvancedMDSearch::performSearch ( )

perform search

public

Parameters

Reimplemented from ilAbstractSearch.

Definition at line 81 of file class.ilAdvancedMDSearch.php.

References $query, $res, $row, ilAbstractSearch\$search_result, ilAbstractSearch\__createLocateString(), DB_FETCHMODE_OBJECT, getDefinition(), ilAbstractSearch\getFilter(), ilAbstractSearch\setFields(), ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

{
global $ilDB;
$this->setFields(array('value'));
$and = '';
if(count($this->getFilter()))
{
$and = "AND ".$ilDB->in('type',$this->getFilter(),false,'text');
}
switch($this->getDefinition()->getFieldType())
{
$query = "SELECT amv.obj_id,type ".
"FROM adv_md_values amv ".
"JOIN object_data od ON amv.obj_id = od.obj_id ".
"WHERE value >= ".$ilDB->quote($this->range_start ,'text')." ".
"AND value <= ".$ilDB->quote($this->range_end ,'text')." ".
"AND field_id = ".$this->db->quote($this->getDefinition()->getFieldId() ,'integer')." ".
$and;
break;
$where = $this->__createWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT amv.obj_id,type ".
$locate.
"FROM adv_md_values amv ".
"JOIN object_data od ON amv.obj_id = od.obj_id ".
$where.
"AND field_id = ".$this->db->quote($this->getDefinition()->getFieldId() ,'integer')." ".
$and;
break;
}
if($query)
{
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->search_result->addEntry($row->obj_id,$row->type,$this->__prepareFound($row));
}
}
}

+ Here is the call graph for this function:

ilAdvancedMDSearch::setDefinition (   $a_def)

set Definition

public

Parameters
objfield definition object

Definition at line 58 of file class.ilAdvancedMDSearch.php.

{
$this->definition = $a_def;
}
ilAdvancedMDSearch::setTimeRange (   $start,
  $end 
)

set time range

public

Parameters
intunix start time
intunix end time

Definition at line 142 of file class.ilAdvancedMDSearch.php.

{
$this->range_start = $start;
$this->range_end = $end;
}

Field Documentation

ilAdvancedMDSearch::$definition
protected

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

Referenced by getDefinition().


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