ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Item.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
23 use ILIAS\UI\Component as C;
28 
32 abstract class Item implements C\Item\Item
33 {
34  use ComponentHelper;
35 
39  protected $title;
40  protected ?string $desc = null;
41  protected array $props;
42  protected ?C\Dropdown\Standard $actions = null;
43 
47  protected $lead = null;
48 
53  public function __construct($title)
54  {
55  if (!$title instanceof Shy && !$title instanceof Link) {
56  $this->checkStringArg("title", $title);
57  }
58 
59  $this->title = $title;
60  $this->props = [];
61  }
62 
66  public function getTitle()
67  {
68  return $this->title;
69  }
70 
74  public function withDescription(string $description): C\Item\Item
75  {
76  $clone = clone $this;
77  $clone->desc = $description;
78  return $clone;
79  }
80 
84  public function getDescription(): ?string
85  {
86  return $this->desc;
87  }
88 
92  public function withProperties(array $properties): C\Item\Item
93  {
94  $clone = clone $this;
95  $clone->props = $properties;
96  return $clone;
97  }
98 
102  public function getProperties(): array
103  {
104  return $this->props;
105  }
106 
110  public function withActions(C\Dropdown\Standard $actions): C\Item\Item
111  {
112  $clone = clone $this;
113  $clone->actions = $actions;
114  return $clone;
115  }
116 
120  public function getActions(): ?C\Dropdown\Standard
121  {
122  return $this->actions;
123  }
124 }
withDescription(string $description)
Definition: Item.php:74
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($title)
Item constructor.
Definition: Item.php:53
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
Common interface to all items.
Definition: Item.php:31
This describes a standard button.
Definition: Standard.php:26
withActions(C\Dropdown\Standard $actions)
Definition: Item.php:110
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21