19 declare(strict_types=1);
43 Type $type = Type::NULL
47 protected bool $active,
53 public function isActive():
bool 58 public function type():
Type 63 public function id():
string 76 foreach ($ids as
$id) {
84 return new class ($vocabulary) extends NullCopyrightBridge {
91 return $this->vocabulary;
99 public function __construct(
protected array $vocabularies)
105 foreach ($this->vocabularies as $vocabulary) {
106 if ($vocab_id === $vocabulary->id()) {
113 public function getVocabulariesForSlots(
SlotIdentifier ...$slots): \Generator
115 yield
from $this->vocabularies;
118 public function getActiveVocabulariesForSlots(
SlotIdentifier ...$slots): \Generator
120 foreach ($this->vocabularies as $vocabulary) {
121 if (!$vocabulary->isActive()) {
132 return new class ($vocabularies) extends NullStandardRepo {
133 public function __construct(
protected array $vocabularies)
139 foreach ($this->vocabularies as $vocabulary) {
140 if ($slot->value === $vocabulary->id()) {
147 public function getVocabularies(
SlotIdentifier ...$slots): \Generator
149 yield
from $this->vocabularies;
152 public function getActiveVocabularies(
SlotIdentifier ...$slots): \Generator
154 foreach ($this->vocabularies as $vocabulary) {
155 if (!$vocabulary->isActive()) {
171 foreach ($vocabs as $vocabulary) {
172 $actual_ids[] = $vocabulary->id();
174 $this->assertSame($ids, $actual_ids);
179 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
180 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
181 $active_standard_vocabs = $this->
getVocabsWithIDs(
true, SlotIdentifier::GENERAL_COVERAGE->value);
182 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false, SlotIdentifier::RIGHTS_COST->value);
186 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
187 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
190 $vocab = $reader->vocabulary(
'something entirely different');
192 $this->assertInstanceOf(NullVocabulary::class,
$vocab);
197 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
198 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
199 $active_standard_vocabs = $this->
getVocabsWithIDs(
true, SlotIdentifier::GENERAL_COVERAGE->value);
200 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false, SlotIdentifier::RIGHTS_COST->value);
204 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
205 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
208 $vocab = $reader->vocabulary(SlotIdentifier::RIGHTS_COST->value);
210 $this->assertSame(SlotIdentifier::RIGHTS_COST->value,
$vocab->id());
214 $cp_vocab = $this->
getVocabulary(
true, SlotIdentifier::RIGHTS_DESCRIPTION->value);
215 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
216 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
217 $active_standard_vocabs = $this->
getVocabsWithIDs(
true, SlotIdentifier::GENERAL_COVERAGE->value);
218 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false, SlotIdentifier::RIGHTS_COST->value);
222 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
223 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
226 $vocab = $reader->vocabulary(SlotIdentifier::RIGHTS_DESCRIPTION->value);
228 $this->assertSame(SlotIdentifier::RIGHTS_DESCRIPTION->value,
$vocab->id());
233 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
234 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
235 $active_standard_vocabs = $this->
getVocabsWithIDs(
true, SlotIdentifier::GENERAL_COVERAGE->value);
236 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false, SlotIdentifier::RIGHTS_COST->value);
240 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
241 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
244 $vocab = $reader->vocabulary(
'contr active 1');
246 $this->assertSame(
'contr active 1',
$vocab->id());
252 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
253 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
254 $active_standard_vocabs = $this->
getVocabsWithIDs(
true,
'stand active 1',
'stand active 2');
255 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false,
'stand inactive 1',
'stand inactive 2');
259 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
260 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
275 $reader->vocabulariesForSlots(SlotIdentifier::RIGHTS_COST)
281 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
282 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
283 $active_standard_vocabs = $this->
getVocabsWithIDs(
true,
'stand active 1',
'stand active 2');
284 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false,
'stand inactive 1',
'stand inactive 2');
288 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
289 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
303 $reader->vocabulariesForSlots(SlotIdentifier::RIGHTS_COST)
310 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
311 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
312 $active_standard_vocabs = $this->
getVocabsWithIDs(
true,
'stand active 1',
'stand active 2');
313 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false,
'stand inactive 1',
'stand inactive 2');
317 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
318 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
329 $reader->activeVocabulariesForSlots(SlotIdentifier::RIGHTS_COST)
335 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
336 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
337 $active_standard_vocabs = $this->
getVocabsWithIDs(
true,
'stand active 1',
'stand active 2');
338 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false,
'stand inactive 1',
'stand inactive 2');
342 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
343 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
353 $reader->activeVocabulariesForSlots(SlotIdentifier::RIGHTS_COST)
360 $active_controlled_vocabs = $this->
getVocabsWithIDs(
true,
'contr active 1',
'contr active 2');
361 $inactive_controlled_vocabs = $this->
getVocabsWithIDs(
false,
'contr inactive 1',
'contr inactive 2');
362 $active_standard_vocabs = $this->
getVocabsWithIDs(
true,
'stand active 1',
'stand active 2');
363 $inactive_standard_vocabs = $this->
getVocabsWithIDs(
false,
'stand inactive 1',
'stand inactive 2');
367 $this->
getControlledRepo(...$active_controlled_vocabs, ...$inactive_controlled_vocabs),
368 $this->
getStandardRepo(...$active_standard_vocabs, ...$inactive_standard_vocabs)
378 $reader->activeVocabulariesForSlots(SlotIdentifier::RIGHTS_COST)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins