ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilMediaPoolSearch.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
5 
18 {
19  public function performSearch(): ilSearchResult
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(
34  (int) $row->mep_id,
35  'mep',
36  $this->__prepareFound($row),
37  (int) $row->obj_id
38  );
39  }
40  return $this->search_result;
41  }
42 
44  {
45  $this->setFields(array('keyword'));
46 
47  $and = $this->__createKeywordAndCondition();
48  $locate = $this->__createLocateString();
49 
50 
51  $query = "SELECT mep_id, child " .
52  $locate .
53  "FROM mep_item mi " .
54  "JOIN mep_tree ON mi.obj_id = child " .
55  "JOIN il_meta_keyword mk ON foreign_id = mk.obj_id " .
56  $and .
57  "AND obj_type = 'mob'";
58 
59  $res = $this->db->query($query);
60  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
61  $this->search_result->addEntry(
62  (int) $row->mep_id,
63  'mep',
64  $this->__prepareFound($row),
65  (int) $row->child
66  );
67  }
68  return $this->search_result;
69  }
70 }
$res
Definition: ltiservices.php:69
setFields(array $a_fields)
$query
ilSearchResult $search_result