ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Icon.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\UI\Implementation\Component\ComponentHelper;
26
27abstract class Icon implements C\Symbol\Icon\Icon
28{
29 use ComponentHelper;
31
35 protected static array $possible_sizes = array(
36 self::SMALL,
37 self::MEDIUM,
38 self::LARGE,
39 self::RESPONSIVE
40 );
41
42 protected string $name;
43 protected string $label;
44 protected string $size;
45 protected ?string $abbreviation = null;
46 protected bool $is_disabled;
47
51 public function getName(): string
52 {
53 return $this->name;
54 }
55
59 public function getLabel(): string
60 {
61 return $this->label;
62 }
63
64 public function setLabel(string $label): void
65 {
66 $this->label = $label;
67 }
68
69 public function withLabel(string $label): self
70 {
71 $clone = clone $this;
72 $clone->label = $label;
73 return $clone;
74 }
75
80 {
81 $clone = clone $this;
82 $clone->abbreviation = $abbreviation;
83 return $clone;
84 }
85
89 public function getAbbreviation(): ?string
90 {
92 }
93
97 public function withSize(string $size): C\Symbol\Icon\Icon
98 {
99 $this->checkArgIsElement(
100 "size",
101 $size,
102 self::$possible_sizes,
103 implode('/', self::$possible_sizes)
104 );
105 $clone = clone $this;
106 $clone->size = $size;
107 return $clone;
108 }
109
113 public function getSize(): string
114 {
115 return $this->size;
116 }
117
121 public function isDisabled(): bool
122 {
123 return $this->is_disabled;
124 }
125
129 public function withDisabled(bool $is_disabled): C\Symbol\Icon\Icon
130 {
131 $clone = clone $this;
132 $clone->is_disabled = $is_disabled;
133 return $clone;
134 }
135}
This describes a symbol.
Definition: Symbol.php:30
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.