ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Item.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
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
__construct($title)
Item constructor.
Definition: Item.php:53
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Common interface to all items.
Definition: Item.php:31
withActions(C\Dropdown\Standard $actions)
Definition: Item.php:110