ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
SettingsManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
29{
31
32 public function __construct(
33 protected InternalDataService $data,
35 protected InternalDomainService $domain
36 ) {
37 $this->repo = $repo->settings();
38 }
39
40 public function save(Settings $settings): void
41 {
42 $this->repo->save($settings);
43 }
44
45 public function getByObjId(int $obj_id): ?Settings
46 {
47 return $this->repo->getByObjId($obj_id);
48 }
49
50 public function delete(int $obj_id): void
51 {
52 $this->repo->delete($obj_id);
53 }
54
55 public function getLangOptions(string $lang = ""): array
56 {
57 $options = [];
58 $this->domain->lng()->loadLanguageModule("meta");
59 foreach ($this->domain->lng()->getInstalledLanguages() as $key) {
60 $options[$key] = $this->domain->lng()->txt('meta_l_' . $key);
61 }
62 if ($lang !== "" && !isset($options[$lang])) {
63 $options[$lang] = $this->domain->lng()->txt('meta_l_' . $lang);
64 }
65 return $options;
66 }
67
68}
__construct(protected InternalDataService $data, InternalRepoService $repo, protected InternalDomainService $domain)
Interface ilDBInterface.