Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00035 include_once 'Services/Search/classes/class.ilAbstractSearch.php';
00036
00037 class ilObjectSearch extends ilAbstractSearch
00038 {
00039
00044 function ilObjectSearch(&$qp_obj)
00045 {
00046 parent::ilAbstractSearch($qp_obj);
00047
00048 $this->setFields(array('title','description'));
00049 }
00050
00051
00052
00053
00054 function &performSearch()
00055 {
00056 $in = $this->__createInStatement();
00057 $where = $this->__createWhereCondition();
00058 $locate = $this->__createLocateString();
00059
00060 $query = "SELECT obj_id,type ".
00061 $locate.
00062 "FROM object_data ".
00063 $where." ".$in.' '.
00064 "ORDER BY obj_id DESC";
00065
00066 $res = $this->db->query($query);
00067 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
00068 {
00069 $this->search_result->addEntry($row->obj_id,$row->type,$this->__prepareFound($row));
00070 }
00071
00072 return $this->search_result;
00073 }
00074
00075
00076
00077
00078 function __createInStatement()
00079 {
00080 $type = "('";
00081 $type .= implode("','",$this->object_types);
00082 $type .= "')";
00083
00084 $in = " AND type IN ".$type;
00085
00086 return $in;
00087 }
00088 }
00089 ?>