ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTestSkillLevelThresholdImportFails.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
32 protected $settings;
33
37 protected $parentObjId;
38
43 public function __construct($parentObjId)
44 {
45 $this->parentObjId = $parentObjId;
46 }
47
51 protected function getSettings(): ilSetting
52 {
53 if ($this->settings === null) {
54 $this->settings = new ilSetting('assimportfails');
55 }
56
57 return $this->settings;
58 }
59
63 protected function getParentObjId(): int
64 {
65 return $this->parentObjId;
66 }
67
71 protected function buildSettingsKey(): string
72 {
73 return 'failed_imp_slt_parentobj_' . $this->getParentObjId();
74 }
75
80 {
81 $value = $this->getSettings()->get($this->buildSettingsKey(), null);
82
83 if ($value !== null) {
84 return unserialize($value);
85 }
86
87 return null;
88 }
89
94 {
95 $this->getSettings()->set($this->buildSettingsKey(), serialize($skillList));
96 }
97
101 {
102 $this->getSettings()->delete($this->buildSettingsKey());
103 }
104
108 public function failedImportsRegistered(): bool
109 {
110 return $this->getFailedImports() !== null;
111 }
112
117 public function getFailedImportsMessage(ilLanguage $lng): string
118 {
119 $msg = $lng->txt('tst_failed_imp_skl_thresholds');
120
121 $msg .= '<ul>';
122 foreach ($this->getFailedImports() as $skill_key) {
123 [$skill_base_id, $skill_tref_id] = explode(':', $skill_key);
124 $skill_title = ilBasicSkill::_lookupTitle((int) $skill_base_id, (int) $skill_tref_id);
125
126 $msg .= '<li>' . $skill_title . '</li>';
127 }
128 $msg .= '</ul>';
129
130 return $msg;
131 }
132}
language handling
ILIAS Setting Class.
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
__construct($parentObjId)
ilTestSkillLevelThresholdImportFails constructor.
registerFailedImports(ilAssQuestionAssignedSkillList $skillList)
global $lng
Definition: privfeed.php:31