Media pool repository.
More...
|
| __construct (\ilDBInterface $db=null) |
|
| getItems (int $pool_id, string $title_filter="", string $format_filter="", string $keyword_filter="", string $caption_filter="") |
|
|
| getMediaObjects (int $pool_id, string $title_filter="", string $format_filter="", string $keyword_filter='', string $caption_filter="") |
|
| getContentSnippets (int $pool_id, string $title_filter="", string $format_filter="", string $keyword_filter='', string $caption_filter="") |
|
Media pool repository.
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 27 of file class.MediaPoolRepository.php.
◆ __construct()
ILIAS\MediaPool\MediaPoolRepository::__construct |
( |
\ilDBInterface |
$db = null | ) |
|
◆ getContentSnippets()
ILIAS\MediaPool\MediaPoolRepository::getContentSnippets |
( |
int |
$pool_id, |
|
|
string |
$title_filter = "" , |
|
|
string |
$format_filter = "" , |
|
|
string |
$keyword_filter = '' , |
|
|
string |
$caption_filter = "" |
|
) |
| |
|
protected |
- Returns
- array[]
Definition at line 103 of file class.MediaPoolRepository.php.
References ILIAS\MediaPool\MediaPoolRepository\$db, $query, $res, and ilMDKeyword\_searchKeywords().
Referenced by ILIAS\MediaPool\MediaPoolRepository\getItems().
111 if (!in_array($format_filter, [
"pg",
""])) {
116 if ($caption_filter !=
"") {
122 $query =
"SELECT DISTINCT mep_tree.*, mep_item.* " .
123 "FROM mep_tree JOIN mep_item ON (mep_tree.child = mep_item.obj_id) ";
126 " WHERE mep_tree.mep_id = " .
$db->
quote($pool_id,
"integer") .
127 " AND mep_item.type = " .
$db->
quote(
"pg",
"text");
130 if (trim($title_filter) !=
"") {
131 $query .=
" AND " .
$db->
like(
"mep_item.title",
"text",
"%" . trim($title_filter) .
"%");
143 if ($keyword_filter) {
144 include_once
'./Services/MetaData/classes/class.ilMDKeyword.php';
146 foreach ($objs as $obj) {
147 if (in_array($obj[
'obj_id'],
$res)) {
151 return (array) $filtered;
fetchAssoc(ilDBStatement $statement)
like(string $column, string $type, string $value="?", bool $case_insensitive=true)
Generate a like subquery.
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
static _searchKeywords(string $a_query, string $a_type, int $a_rbac_id=0)
◆ getItems()
ILIAS\MediaPool\MediaPoolRepository::getItems |
( |
int |
$pool_id, |
|
|
string |
$title_filter = "" , |
|
|
string |
$format_filter = "" , |
|
|
string |
$keyword_filter = "" , |
|
|
string |
$caption_filter = "" |
|
) |
| |
◆ getMediaObjects()
ILIAS\MediaPool\MediaPoolRepository::getMediaObjects |
( |
int |
$pool_id, |
|
|
string |
$title_filter = "" , |
|
|
string |
$format_filter = "" , |
|
|
string |
$keyword_filter = '' , |
|
|
string |
$caption_filter = "" |
|
) |
| |
|
protected |
- Returns
- array[]
Definition at line 40 of file class.MediaPoolRepository.php.
References ILIAS\MediaPool\MediaPoolRepository\$db, $query, $res, and ilMDKeyword\_searchKeywords().
Referenced by ILIAS\MediaPool\MediaPoolRepository\getItems().
49 $query =
"SELECT DISTINCT mep_tree.*, object_data.* " .
50 "FROM mep_tree JOIN mep_item ON (mep_tree.child = mep_item.obj_id) " .
51 " JOIN object_data ON (mep_item.foreign_id = object_data.obj_id) ";
53 if ($format_filter !=
"" or $caption_filter !=
'') {
54 $query .=
" JOIN media_item ON (media_item.mob_id = object_data.obj_id) ";
58 " WHERE mep_tree.mep_id = " .
$db->
quote($pool_id,
"integer") .
59 " AND object_data.type = " .
$db->
quote(
"mob",
"text");
62 if (trim($title_filter) !=
"") {
63 $query .=
" AND " .
$db->
like(
"object_data.title",
"text",
"%" . trim($title_filter) .
"%");
65 if (!in_array($format_filter, [
"",
"mob"])) {
66 $filter = ($format_filter ===
"unknown")
69 $query .=
" AND " .
$db->
equals(
"media_item.format", $filter,
"text",
true);
71 if (trim($caption_filter)) {
72 $query .=
'AND ' .
$db->
like(
'media_item.caption',
'text',
'%' . trim($caption_filter) .
'%');
76 " ORDER BY object_data.title";
81 $rec[
"foreign_id"] = $rec[
"obj_id"];
87 if ($keyword_filter) {
90 foreach ($objs as $obj) {
91 if (in_array($obj[
'foreign_id'],
$res)) {
95 return (array) $filtered;
equals(string $columns, $value, string $type, bool $emptyOrNull=false)
fetchAssoc(ilDBStatement $statement)
like(string $column, string $type, string $value="?", bool $case_insensitive=true)
Generate a like subquery.
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
static _searchKeywords(string $a_query, string $a_type, int $a_rbac_id=0)
◆ $db
The documentation for this class was generated from the following file: