ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Group.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\UI\Implementation\Component\ComponentHelper;
26
30class Group implements Item\Group
31{
32 use ComponentHelper;
33
34 protected string $title;
35
39 protected array $items;
40 protected ?Dropdown\Standard $actions = null;
41
45 public function __construct(string $title, array $items)
46 {
47 $this->title = $title;
48 $this->items = $items;
49 }
50
54 public function getTitle(): string
55 {
56 return $this->title;
57 }
58
62 public function getItems(): array
63 {
64 return $this->items;
65 }
66
70 public function withActions(Dropdown\Standard $dropdown): Item\Group
71 {
72 $clone = clone $this;
73 $clone->actions = $dropdown;
74 return $clone;
75 }
76
80 public function getActions(): ?Dropdown\Standard
81 {
82 return $this->actions;
83 }
84}
__construct(string $title, array $items)
Definition: Group.php:45
withActions(Dropdown\Standard $dropdown)
Definition: Group.php:70
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:35
Common interface to item groups.
Definition: Group.php:30
Common interface to all items.
Definition: Item.php:32