ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Standard.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2017 Alex Killing <killing@leifos.de> Extended GPL, see docs/LICENSE */
4
6
8
9class Standard extends Item implements C\Item\Standard
10{
14 protected $color = null;
18 protected $lead = null;
19
23 public function withColor(\ILIAS\Data\Color $color) : C\Item\Item
24 {
25 $clone = clone $this;
26 $clone->color = $color;
27 return $clone;
28 }
29
33 public function getColor() : ?\ILIAS\Data\Color
34 {
35 return $this->color;
36 }
37
41 public function withLeadImage(\ILIAS\UI\Component\Image\Image $image) : C\Item\Item
42 {
43 $clone = clone $this;
44 $clone->lead = $image;
45 return $clone;
46 }
47
51 public function withLeadIcon(\ILIAS\UI\Component\Symbol\Icon\Icon $icon) : C\Item\Item
52 {
53 $clone = clone $this;
54 $clone->lead = $icon;
55 return $clone;
56 }
57
61 public function withLeadText(string $text) : C\Item\Item
62 {
63 $this->checkStringArg("lead_text", $text);
64 $clone = clone $this;
65 $clone->lead = (string) $text;
66 return $clone;
67 }
68
72 public function withNoLead() : C\Item\Item
73 {
74 $clone = clone $this;
75 $clone->lead = null;
76 return $clone;
77 }
78
82 public function getLead()
83 {
84 return $this->lead;
85 }
86}
An exception for terminatinating execution or to throw for unit testing.
Common interface to all items.
Definition: Item.php:14
withLeadImage(\ILIAS\UI\Component\Image\Image $image)
Definition: Standard.php:41
withLeadIcon(\ILIAS\UI\Component\Symbol\Icon\Icon $icon)
Definition: Standard.php:51
A component is the most general form of an entity in the UI.
Definition: Component.php:14
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.