19 declare(strict_types=1);
42 return new class ($type, $value, $vocab_slot) extends
NullData {
45 protected string $value,
49 $this->value = $value;
50 $this->vocab_slot = $vocab_slot;
53 public function type():
Type 58 public function value():
string 65 return $this->vocab_slot;
72 $format = $this->createMock(DateFormat::class);
73 $format->method(
'applyTo')->willReturnCallback(
function (\
DateTimeImmutable $arg) {
74 return $arg->format(
'd:m:Y');
82 $this->format = $format;
85 public function getUserDateFormat():
DateFormat 90 public function txt(
string $key):
string 92 return 'translated ' . $key;
97 public function durationToIterator(
string $duration): \Generator
99 foreach (explode(
':', $duration) as $v) {
108 public function datetimeToObject(
string $datetime): \DateTimeImmutable
110 return new \DateTimeImmutable($datetime);
114 $vocab_presentation =
new class () extends NullVocabulariesPresentation {
115 public function presentableLabels(
118 bool $with_unknown_vocab_flag,
121 foreach ($values as $value) {
122 yield
new class ($value, $slot, $with_unknown_vocab_flag) extends
NullLabelledValue {
124 protected string $value,
126 protected bool $with_unknown_vocab_flag
130 public function value():
string 135 public function label():
string 137 return 'vocab ' . $this->slot->value .
' ' .
138 $this->value . ($this->with_unknown_vocab_flag ?
' flagged' :
'');
145 return new Data($util, $helper, $vocab_presentation);
152 'vocab rights_cost SomeKey',
153 $data->vocabularyValue(
'SomeKey', SlotIdentifier::RIGHTS_COST),
161 'translated meta_l_key',
162 $data->language(
'key')
171 $data->datetime(
'2012-12-31')
179 '89 translated years, 0 translated months, 1 translated second',
180 $data->duration(
'89:0::::1')
188 'vocab rights_cost SomeKey',
189 $data->dataValue($this->getElementData(
192 SlotIdentifier::RIGHTS_COST
196 'vocab rights_cost SomeKey',
197 $data->dataValue($this->getElementData(
200 SlotIdentifier::RIGHTS_COST
204 'translated meta_l_key',
205 $data->dataValue($this->getElementData(Type::LANG,
'key'))
209 $data->dataValue($this->getElementData(Type::DATETIME,
'2012-12-31'))
212 '89 translated years, 5 translated months, 1 translated second',
216 'This should just go through.',
217 $data->dataValue($this->getElementData(Type::VOCAB_SOURCE,
'This should just go through.'))
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.