19 declare(strict_types=1);
49 return $this->element_helper->findElementOfCondition($slot, $element, ...$all_elements);
54 return $this->element_helper->slotForElement($element);
62 return $this->element_helper->slotsForElementWithoutCondition($element);
70 return $this->element_helper->potentialSlotForElementByCondition(
72 $element_in_condition,
83 if (!isset($this->cached_vocabularies_by_slot[$slot->value])) {
84 $this->cached_vocabularies_by_slot[$slot->value] = iterator_to_array(
85 $this->reader->activeVocabulariesForSlots($slot),
89 yield
from $this->cached_vocabularies_by_slot[$slot->value];
100 if (!$vocab->allowsCustomInputs()) {
112 if (in_array($value, iterator_to_array($vocab->values()),
true)) {
124 ?
string $add_if_not_included =
null 128 $values_from_vocab = iterator_to_array($vocab->values());
129 $values = array_merge($values, $values_from_vocab);
132 if (isset($add_if_not_included) && !in_array($add_if_not_included, $values)) {
133 array_unshift($values, $add_if_not_included);
140 $sources_by_value = [];
142 $values_from_vocab = iterator_to_array($vocab->values());
143 $sources_by_value = array_merge(
145 array_fill_keys($values_from_vocab, $vocab->source())
149 return function (
string $value) use ($sources_by_value) {
150 return $sources_by_value[$value] ??
null;
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null