ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilMediaPoolSearch.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
31{
32 public function performSearch(): ilSearchResult
33 {
34 $this->setFields(array('title'));
35
36 $and = $this->__createAndCondition();
37 $locate = $this->__createLocateString();
38
39 $query = "SELECT mep_id, obj_id, type " .
40 $locate .
41 "FROM mep_tree JOIN mep_item ON child = obj_id " .
42 $and;
43
44 $res = $this->db->query($query);
45 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
46 $this->search_result->addEntry(
47 (int) $row->mep_id,
48 'mep',
49 $this->__prepareFound($row),
50 (int) $row->obj_id,
51 (string) $row->type
52 );
53 }
55 }
56
58 {
59 $this->setFields(array('keyword'));
60
61 $and = $this->__createKeywordAndCondition();
62 $locate = $this->__createLocateString();
63
64
65 $query = "SELECT mep_id, child, type " .
66 $locate .
67 "FROM mep_item mi " .
68 "JOIN mep_tree ON mi.obj_id = child " .
69 "JOIN il_meta_keyword mk ON foreign_id = mk.obj_id " .
70 $and .
71 "AND obj_type = 'mob'";
72
73 $res = $this->db->query($query);
74 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
75 $this->search_result->addEntry(
76 (int) $row->mep_id,
77 'mep',
78 $this->__prepareFound($row),
79 (int) $row->child,
80 (string) $row->type
81 );
82 }
84 }
85}
setFields(array $a_fields)
ilSearchResult $search_result
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69