ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjectSearch Class Reference
+ Inheritance diagram for ilObjectSearch:
+ Collaboration diagram for ilObjectSearch:

Public Member Functions

 ilObjectSearch (&$qp_obj)
 Constructor public.
performSearch ()
 __createInStatement ()
- 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)

Additional Inherited Members

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

Detailed Description

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

Member Function Documentation

ilObjectSearch::__createInStatement ( )

Definition at line 77 of file class.ilObjectSearch.php.

References $ilDB, $in, and ilAbstractSearch\getIdFilter().

Referenced by performSearch().

{
global $ilDB;
$in = ' AND '.$ilDB->in('type',(array) $this->object_types,false,'text');
if($this->getIdFilter())
{
$in .= ' AND ';
$in .= $ilDB->in('obj_id',$this->getIdFilter(),false,'integer');
}
return $in;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjectSearch::ilObjectSearch ( $qp_obj)

Constructor public.

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

References ilAbstractSearch\ilAbstractSearch(), and ilAbstractSearch\setFields().

Referenced by ilFulltextObjectSearch\ilFulltextObjectSearch(), and ilLikeObjectSearch\ilLikeObjectSearch().

{
$this->setFields(array('title','description'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilObjectSearch::performSearch ( )

Reimplemented from ilAbstractSearch.

Definition at line 54 of file class.ilObjectSearch.php.

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

{
$where = $this->__createWhereCondition();
$locate = $this->__createLocateString();
$query = "SELECT obj_id,type ".
$locate.
"FROM object_data ".
$where." ".$in.' '.
"ORDER BY obj_id DESC";
$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:


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