19 declare(strict_types=1);
50 ?
string $byline = null
52 $this->checkArgListElements(
'inputs', $inputs, [
I\Group::class]);
61 if ($this->requirement_constraint !== null) {
62 return $this->requirement_constraint;
73 if (!is_string($value) && !is_int($value)) {
76 return array_key_exists($value, $this->
getInputs());
88 public function withValue($value): I\Input
90 if (is_string($value) || is_int($value)) {
94 if (!is_array($value) || count($value) !== 2) {
96 "Expected one key and a group value or one key only as value." 97 .
" got '" . print_r($value,
true) .
"' instead." 100 list(
$key, $group_value) = $value;
104 $clone->setInputs($clone->getInputsWithOperationForKey(
$key, fn (
$i) =>
$i->withValue($group_value)));
119 if (null === $input) {
123 return [
$key, $input->getValue()];
131 if ($this->
getName() === null) {
132 throw new LogicException(
"Can only collect if input has a name.");
136 $clone = clone $this;
140 $clone->content = $clone->data_factory->error($this->
lng->txt(
"ui_error_switchable_group_required"));
141 return $clone->withError(
"" . $clone->content->error());
144 $clone->content = $clone->data_factory->ok([
$key, []]);
149 $clone = $clone->withValue(
$key);
150 $clone->setInputs($clone->getInputsWithOperationForKey(
$key, fn (
$i) =>
$i->withInput($input)));
156 $clone->content = $clone->data_factory->ok([
$key, []]);
161 $clone->content = $clone->data_factory->error($this->
lng->txt(
"ui_error_in_group"));
167 $content = $group_input->getContent();
168 if ($content->isOK()) {
169 $contents[$subkey] = $content->value();
174 if ($clone->content->isError()) {
175 return $clone->withError(
"" . $clone->content->error());
188 $this->checkArg(
"key", is_int(
$key) || is_string(
$key),
"Key must be int or string.");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
Refinery Factory $refinery