‪TYPO3CMS  10.4
WidgetConfiguration.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 {
25  private ‪$identifier;
26 
30  private ‪$serviceName;
31 
35  private ‪$groupNames;
36 
40  private ‪$title;
41 
45  private ‪$description;
46 
50  private ‪$iconIdentifier;
51 
55  private ‪$height;
56 
60  private ‪$width;
61 
66 
70  public function ‪__construct(
71  string ‪$identifier,
72  string ‪$serviceName,
73  array ‪$groupNames,
74  string ‪$title,
75  string ‪$description,
76  string ‪$iconIdentifier,
77  string ‪$height,
78  string ‪$width,
80  ) {
81  $allowedSizes = ['small', 'medium', 'large'];
82  if (!in_array(‪$height, $allowedSizes, true)) {
83  throw new \InvalidArgumentException('Height of widgets has to be small, medium or large', 1584778196);
84  }
85  if (!in_array(‪$height, $allowedSizes, true)) {
86  throw new \InvalidArgumentException('Width of widgets has to be small, medium or large', 1585249769);
87  }
88 
89  $this->identifier = ‪$identifier;
90  $this->serviceName = ‪$serviceName;
91  $this->groupNames = ‪$groupNames;
92  $this->title = ‪$title;
93  $this->description = ‪$description;
94  $this->iconIdentifier = ‪$iconIdentifier;
95  $this->height = ‪$height;
96  $this->width = ‪$width;
97  $this->additionalCssClasses = ‪$additionalCssClasses;
98  }
99 
100  public function ‪getIdentifier(): string
101  {
102  return ‪$this->identifier;
103  }
104 
105  public function ‪getServiceName(): string
106  {
107  return ‪$this->serviceName;
108  }
109 
110  public function ‪getGroupNames(): array
111  {
112  return ‪$this->groupNames;
113  }
114 
115  public function ‪getTitle(): string
116  {
117  return ‪$this->title;
118  }
119 
120  public function ‪getDescription(): string
121  {
122  return ‪$this->description;
123  }
124 
125  public function ‪getIconIdentifier(): string
126  {
128  }
129 
130  public function ‪getHeight(): string
131  {
132  return ‪$this->height;
133  }
134 
135  public function ‪getWidth(): string
136  {
137  return ‪$this->width;
138  }
139 
140  public function ‪getAdditionalCssClasses(): string
141  {
142  return implode(' ', $this->additionalCssClasses);
143  }
144 }
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$width
‪string $width
Definition: WidgetConfiguration.php:52
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$title
‪string $title
Definition: WidgetConfiguration.php:36
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getGroupNames
‪getGroupNames()
Definition: WidgetConfiguration.php:101
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getTitle
‪getTitle()
Definition: WidgetConfiguration.php:106
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$groupNames
‪array $groupNames
Definition: WidgetConfiguration.php:32
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$height
‪string $height
Definition: WidgetConfiguration.php:48
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration
Definition: WidgetConfiguration.php:21
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$serviceName
‪string $serviceName
Definition: WidgetConfiguration.php:28
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getServiceName
‪getServiceName()
Definition: WidgetConfiguration.php:96
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\__construct
‪__construct(string $identifier, string $serviceName, array $groupNames, string $title, string $description, string $iconIdentifier, string $height, string $width, array $additionalCssClasses)
Definition: WidgetConfiguration.php:61
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getHeight
‪getHeight()
Definition: WidgetConfiguration.php:121
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getAdditionalCssClasses
‪getAdditionalCssClasses()
Definition: WidgetConfiguration.php:131
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getDescription
‪getDescription()
Definition: WidgetConfiguration.php:111
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getIconIdentifier
‪getIconIdentifier()
Definition: WidgetConfiguration.php:116
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$identifier
‪string $identifier
Definition: WidgetConfiguration.php:24
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$description
‪string $description
Definition: WidgetConfiguration.php:40
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getIdentifier
‪getIdentifier()
Definition: WidgetConfiguration.php:91
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$additionalCssClasses
‪array $additionalCssClasses
Definition: WidgetConfiguration.php:56
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getWidth
‪getWidth()
Definition: WidgetConfiguration.php:126
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\$iconIdentifier
‪string $iconIdentifier
Definition: WidgetConfiguration.php:44