ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
15 include_once 'Services/Search/classes/class.ilAbstractSearch.php';
16 
18 {
19  public function performSearch()
20  {
21  $this->setFields(array('title'));
22 
23  $and = $this->__createAndCondition();
24  $locate = $this->__createLocateString();
25 
26  $query = "SELECT mep_id,obj_id " .
27  $locate .
28  "FROM mep_tree JOIN mep_item ON child = obj_id " .
29  $and;
30 
31  $res = $this->db->query($query);
32  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
33  $this->search_result->addEntry($row->mep_id, 'mep', $this->__prepareFound($row), $row->obj_id);
34  }
35  return $this->search_result;
36  }
37 
38  public function performKeywordSearch()
39  {
40  $this->setFields(array('keyword'));
41 
42  $and = $this->__createKeywordAndCondition();
43  $locate = $this->__createLocateString();
44 
45 
46  $query = "SELECT mep_id, child " .
47  $locate .
48  "FROM mep_item mi " .
49  "JOIN mep_tree ON mi.obj_id = child " .
50  "JOIN il_meta_keyword mk ON foreign_id = mk.obj_id " .
51  $and .
52  "AND obj_type = 'mob'";
53 
54  $res = $this->db->query($query);
55  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
56  $this->search_result->addEntry($row->mep_id, 'mep', $this->__prepareFound($row), $row->child);
57  }
58  return $this->search_result;
59  }
60 }
__createLocateString()
build locate string in case of AND search
setFields($a_fields)
Set fields to search.
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.