ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.MetadataManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
27 protected LOMServices $lom_services;
28
29 public function __construct(LOMServices $lom_services)
30 {
31 $this->lom_services = $lom_services;
32 }
33
34 public function getLOMLanguagesForSelectInputs(): array
35 {
36 $languages = [];
37 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
38 $languages[$language->value()] = $language->presentableLabel();
39 }
40 return $languages;
41 }
42
46 public function filterObjIdsByCopyright(array $obj_ids, string $copyright_id): array
47 {
48 $clause = $this->lom_services->copyrightHelper()->getCopyrightSearchClause($copyright_id);
49 $filters = [];
50 foreach ($obj_ids as $obj_id) {
51 $filters[] = $this->lom_services->search()->getFilter($obj_id, 0);
52 }
53 $search_result = $this->lom_services->search()->execute(
54 $clause,
55 null,
56 null,
57 ...$filters
58 );
59
60 $result = [];
61 foreach ($search_result as $ressource_id) {
62 $result[] = $ressource_id->objID();
63 }
64 return $result;
65 }
66}
filterObjIdsByCopyright(array $obj_ids, string $copyright_id)