[TASK] Remove ext:dbal from installation steps
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / View / BackendLayout / BackendLayout.php
1 <?php
2 namespace TYPO3\CMS\Backend\View\BackendLayout;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Class to represent a backend layout.
19 */
20 class BackendLayout
21 {
22 /**
23 * @var string
24 */
25 protected $identifier;
26
27 /**
28 * @var string
29 */
30 protected $title;
31
32 /**
33 * @var string
34 */
35 protected $description;
36
37 /**
38 * @var string
39 */
40 protected $iconPath;
41
42 /**
43 * @var string
44 */
45 protected $configuration;
46
47 /**
48 * @var array
49 */
50 protected $data;
51
52 /**
53 * @param string $identifier
54 * @param string $title
55 * @param string $configuration
56 * @return BackendLayout
57 */
58 public static function create($identifier, $title, $configuration)
59 {
60 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
61 BackendLayout::class,
62 $identifier,
63 $title,
64 $configuration
65 );
66 }
67
68 /**
69 * @param string $identifier
70 * @param string $title
71 * @param string $configuration
72 */
73 public function __construct($identifier, $title, $configuration)
74 {
75 $this->setIdentifier($identifier);
76 $this->setTitle($title);
77 $this->setConfiguration($configuration);
78 }
79
80 /**
81 * @return string
82 */
83 public function getIdentifier()
84 {
85 return $this->identifier;
86 }
87
88 /**
89 * @param string $identifier
90 * @throws \UnexpectedValueException
91 */
92 public function setIdentifier($identifier)
93 {
94 if (strpos($identifier, '__') !== false) {
95 throw new \UnexpectedValueException(
96 'Identifier "' . $identifier . '" must not contain "__"',
97 1381597630
98 );
99 }
100
101 $this->identifier = $identifier;
102 }
103
104 /**
105 * @return string
106 */
107 public function getTitle()
108 {
109 return $this->title;
110 }
111
112 /**
113 * @param string $title
114 */
115 public function setTitle($title)
116 {
117 $this->title = $title;
118 }
119
120 /**
121 * @return string
122 */
123 public function getDescription()
124 {
125 return $this->description;
126 }
127
128 /**
129 * @param string $description
130 */
131 public function setDescription($description)
132 {
133 $this->description = $description;
134 }
135
136 /**
137 * @return string
138 */
139 public function getIconPath()
140 {
141 return $this->iconPath;
142 }
143
144 /**
145 * @param string $iconPath
146 */
147 public function setIconPath($iconPath)
148 {
149 $this->iconPath = $iconPath;
150 }
151
152 /**
153 * @return string
154 */
155 public function getConfiguration()
156 {
157 return $this->configuration;
158 }
159
160 /**
161 * @param string $configuration
162 */
163 public function setConfiguration($configuration)
164 {
165 $this->configuration = $configuration;
166 }
167
168 /**
169 * @return array
170 */
171 public function getData()
172 {
173 return $this->data;
174 }
175
176 /**
177 * @param array $data
178 */
179 public function setData(array $data)
180 {
181 $this->data = $data;
182 }
183 }