‪TYPO3CMS  ‪main
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  public function ‪__construct(
26  private readonly string ‪$identifier,
27  private readonly string $serviceName,
28  private readonly array $groupNames,
29  private readonly string $title,
30  private readonly string $description,
31  private readonly string $iconIdentifier,
32  private readonly string $height,
33  private readonly string $width,
34  private readonly array $additionalCssClasses
35  ) {
36  $allowedSizes = ['small', 'medium', 'large'];
37  if (!in_array($height, $allowedSizes, true)) {
38  throw new \InvalidArgumentException('Height of widgets has to be small, medium or large', 1584778196);
39  }
40  if (!in_array($height, $allowedSizes, true)) {
41  throw new \InvalidArgumentException('Width of widgets has to be small, medium or large', 1585249769);
42  }
43  }
44 
45  public function ‪getIdentifier(): string
46  {
47  return ‪$this->identifier;
48  }
49 
50  public function ‪getServiceName(): string
51  {
52  return $this->serviceName;
53  }
54 
55  public function ‪getGroupNames(): array
56  {
57  return $this->groupNames;
58  }
59 
60  public function ‪getTitle(): string
61  {
62  return $this->title;
63  }
64 
65  public function ‪getDescription(): string
66  {
67  return $this->description;
68  }
69 
70  public function ‪getIconIdentifier(): string
71  {
72  return $this->iconIdentifier;
73  }
74 
75  public function ‪getHeight(): string
76  {
77  return $this->height;
78  }
79 
80  public function ‪getWidth(): string
81  {
82  return $this->width;
83  }
84 
85  public function ‪getAdditionalCssClasses(): string
86  {
87  return implode(' ', $this->additionalCssClasses);
88  }
89 }
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getGroupNames
‪getGroupNames()
Definition: WidgetConfiguration.php:55
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getTitle
‪getTitle()
Definition: WidgetConfiguration.php:60
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration
Definition: WidgetConfiguration.php:21
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getServiceName
‪getServiceName()
Definition: WidgetConfiguration.php:50
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getHeight
‪getHeight()
Definition: WidgetConfiguration.php:75
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getAdditionalCssClasses
‪getAdditionalCssClasses()
Definition: WidgetConfiguration.php:85
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getDescription
‪getDescription()
Definition: WidgetConfiguration.php:65
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getIconIdentifier
‪getIconIdentifier()
Definition: WidgetConfiguration.php:70
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getIdentifier
‪getIdentifier()
Definition: WidgetConfiguration.php:45
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\getWidth
‪getWidth()
Definition: WidgetConfiguration.php:80
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfiguration\__construct
‪__construct(private readonly string $identifier, private readonly string $serviceName, private readonly array $groupNames, private readonly string $title, private readonly string $description, private readonly string $iconIdentifier, private readonly string $height, private readonly string $width, private readonly array $additionalCssClasses)
Definition: WidgetConfiguration.php:25