ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
TreeSelect.php
Go to the documentation of this file.
1 <?php
2 
18 declare(strict_types=1);
19 
21 
22 use ILIAS\UI\Component as C;
27 
31 class TreeSelect extends HasDynamicInputs implements C\Input\Field\TreeSelect
32 {
33  public function __construct(
34  Language $language,
35  DataFactory $data_factory,
37  C\Input\Container\Form\FormInput $dynamic_input_template,
38  protected C\Input\Field\Node\NodeRetrieval $node_retrieval,
39  string $label,
40  ?string $byline = null
41  ) {
43  $language,
44  $data_factory,
45  $refinery,
46  $dynamic_input_template,
47  $label,
48  $byline
49  );
50  }
51 
52  public function getNodeRetrieval(): C\Input\Field\Node\NodeRetrieval
53  {
54  return $this->node_retrieval;
55  }
56 
57  public function getUpdateOnLoadCode(): \Closure
58  {
59  return static fn($id) => '';
60  }
61 
62  protected function getConstraintForRequirement(): ?Constraint
63  {
64  if ($this->requirement_constraint !== null) {
66  }
67 
68  return $this->refinery->logical()->logicalOr([
69  $this->refinery->numeric()->isNumeric(),
70  $this->refinery->string()->hasMinLength(1),
71  ])->withProblemBuilder(fn($txt, $value) => sprintf($txt('not_greater_than'), 0));
72  }
73 
74  protected function isClientSideValueOk($value): bool
75  {
76  if (is_null($value)) {
78  }
79  if (!is_string($value) && !is_int($value)) {
80  return false;
81  }
83  }
84 }
This implements commonalities between inputs.
Definition: Input.php:42
__construct(Language $language, DataFactory $data_factory, Refinery $refinery, C\Input\Container\Form\FormInput $dynamic_input_template, protected C\Input\Field\Node\NodeRetrieval $node_retrieval, string $label, ?string $byline=null)
Definition: TreeSelect.php:33
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
This implements commonalities between all forms.
Definition: Form.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Checkbox.php:21
Describes an Input Field which dynamically generates inputs according to a template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$txt
Definition: error.php:31
withProblemBuilder(callable $builder)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(Container $dic, ilPlugin $plugin)
This describes inputs that can be used in forms.
Definition: FormInput.php:32