ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Group.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
26 
30 class 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 }
Common interface to item groups.
Definition: Group.php:29
withActions(Dropdown\Standard $dropdown)
Definition: Group.php:70
This describes commonalities between all types of Dropdowns.
Definition: Dropdown.php:34
Common interface to all items.
Definition: Item.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
This describes a standard button.
Definition: Standard.php:26
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Dropdown.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
__construct(string $title, array $items)
Definition: Group.php:45