ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Icon.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;
26 
27 abstract 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 
79  public function withAbbreviation(string $abbreviation): C\Symbol\Icon\Icon
80  {
81  $clone = clone $this;
82  $clone->abbreviation = $abbreviation;
83  return $clone;
84  }
85 
89  public function getAbbreviation(): ?string
90  {
91  return $this->abbreviation;
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 }
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null