ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMediaPoolSearch.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
15include_once 'Services/Search/classes/class.ilAbstractSearch.php';
16
18{
24 {
25 parent::ilAbstractSearch($query_parser);
26 }
27
28
29
30 function &performSearch()
31 {
32 $this->setFields(array('title'));
33
34 $and = $this->__createAndCondition();
35 $locate = $this->__createLocateString();
36
37 $query = "SELECT mep_id,obj_id ".
38 $locate.
39 "FROM mep_tree JOIN mep_item ON child = obj_id ".
40 $and;
41
42 $res = $this->db->query($query);
43 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
44 {
45 $this->search_result->addEntry($row->mep_id,'mep',$this->__prepareFound($row),$row->obj_id);
46 }
48 }
49
50 public function performKeywordSearch()
51 {
52 $this->setFields(array('keyword'));
53
54 $and = $this->__createKeywordAndCondition();
55 $locate = $this->__createLocateString();
56
57
58 $query = "SELECT mep_id, child ".
59 $locate.
60 "FROM mep_item mi ".
61 "JOIN mep_tree ON mi.obj_id = child ".
62 "JOIN il_meta_keyword mk ON foreign_id = mk.obj_id ".
63 $and.
64 "AND obj_type = 'mob'";
65
66 $res = $this->db->query($query);
67 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
68 {
69 $this->search_result->addEntry($row->mep_id,'mep',$this->__prepareFound($row),$row->child);
70 }
72 }
73}
74?>
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
ilMediaPoolSearch(&$query_parser)
Constructor @access public.