19declare(strict_types=1);
29use ILIAS\UI\Implementation\Component\ComponentHelper;
36use InvalidArgumentException;
79 protected DataFactory $data_factory,
104 $clone = clone $this;
132 $clone = clone $this;
150 $clone = clone $this;
151 $clone->setAdditionalTransformation($trafo);
163 $this->operations[] = $trafo;
164 if ($this->content !==
null) {
165 if (!$this->content->isError()) {
166 $this->content = $trafo->
applyTo($this->content);
168 if ($this->content->isError()) {
169 $this->
setError($this->content->error());
179 return $this->dedicated_name;
187 $clone = clone $this;
188 $clone->dedicated_name = $dedicated_name;
205 $clone = clone $this;
209 $clone->name = ($parent_name !==
null) ? $parent_name .
'/' :
'';
211 $clone->name .= ($clone->dedicated_name !==
null)
212 ? $source->getNewDedicatedName($clone->dedicated_name)
225 if ($this->
getName() ===
null) {
226 throw new LogicException(
"Can only collect if input has a name.");
241 if ($clone->content->isError()) {
242 $error = $clone->content->error();
243 if (
$error instanceof \Exception) {
246 return $clone->withError(
"" .
$error);
259 $res = $this->data_factory->ok(
$res);
261 if (
$res->isError()) {
277 foreach ($this->operations as $op) {
287 if (is_null($this->content)) {
288 throw new LogicException(
"No content of this field has been evaluated yet. Seems withRequest was not called.");
290 return $this->content;
A result encapsulates a value or an error and simplifies the handling of those.
A constraint encodes some resrtictions on values.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
foreach($_POST as $key=> $value) $res