1<?php
2
3/*
4 * This file is part of the TYPO3 CMS project.
5 *
6 * It is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License, either version 2
8 * of the License, or any later version.
9 *
10 * For the full copyright and license information, please read the
11 * LICENSE.txt file that was distributed with this source code.
12 *
13 * The TYPO3 project - inspiring people to share!
14 */
15
16namespace TYPO3\CMS\Backend\Domain\Model\Module;
17
18/**
19 * Model for menu entries
20 */
21class BackendModule
22{
23    /**
24     * @var string
25     */
26    protected $title = '';
27
28    /**
29     * @var string
30     */
31    protected $name = '';
32
33    /**
34     * @var string
35     */
36    protected $icon = '';
37
38    /**
39     * @var string
40     */
41    protected $link = '';
42
43    /**
44     * @var string
45     */
46    protected $onClick = '';
47
48    /**
49     * @var string
50     */
51    protected $description = '';
52
53    /**
54     * @var string
55     */
56    protected $navigationComponentId = '';
57
58    /**
59     * @var string
60     */
61    protected $navigationFrameScript = '';
62
63    /**
64     * @var string
65     */
66    protected $navigationFrameScriptParameters = '';
67
68    /**
69     * @var \SplObjectStorage
70     */
71    protected $children;
72
73    /**
74     * @var bool
75     */
76    protected $collapsed = false;
77
78    /**
79     * Standalone modules are top-level modules without a group
80     *
81     * @var bool
82     */
83    protected $standalone = false;
84
85    /**
86     * construct
87     */
88    public function __construct()
89    {
90        $this->children = new \SplObjectStorage();
91    }
92
93    /**
94     * Set children
95     *
96     * @param \SplObjectStorage $children
97     */
98    public function setChildren($children)
99    {
100        $this->children = $children;
101    }
102
103    /**
104     * Get children
105     *
106     * @return \SplObjectStorage
107     */
108    public function getChildren()
109    {
110        return $this->children;
111    }
112
113    /**
114     * Add Child
115     *
116     * @param \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $child
117     */
118    public function addChild(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $child)
119    {
120        $this->children->attach($child);
121    }
122
123    /**
124     * Set icon
125     *
126     * @param string $icon
127     */
128    public function setIcon($icon)
129    {
130        $this->icon = $icon;
131    }
132
133    /**
134     * Get icon
135     *
136     * @return string
137     */
138    public function getIcon()
139    {
140        return $this->icon;
141    }
142
143    /**
144     * Set name
145     *
146     * @param string $name
147     */
148    public function setName($name)
149    {
150        $this->name = $name;
151    }
152
153    /**
154     * Get name
155     *
156     * @return string
157     */
158    public function getName()
159    {
160        return $this->name;
161    }
162
163    /**
164     * Set title
165     *
166     * @param string $title
167     */
168    public function setTitle($title)
169    {
170        $this->title = $title;
171    }
172
173    /**
174     * Get Title
175     *
176     * @return string
177     */
178    public function getTitle()
179    {
180        return $this->title;
181    }
182
183    /**
184     * Set Link
185     *
186     * @param string $link
187     */
188    public function setLink($link)
189    {
190        $this->link = $link;
191    }
192
193    /**
194     * Get Link
195     *
196     * @return string
197     */
198    public function getLink()
199    {
200        return $this->link;
201    }
202
203    /**
204     * Set Description
205     *
206     * @param string $description
207     */
208    public function setDescription($description)
209    {
210        $this->description = $description;
211    }
212
213    /**
214     * Get Description
215     *
216     * @return string
217     */
218    public function getDescription()
219    {
220        return $this->description;
221    }
222
223    /**
224     * Set Navigation Component Id
225     *
226     * @param string $navigationComponentId
227     */
228    public function setNavigationComponentId($navigationComponentId)
229    {
230        $this->navigationComponentId = $navigationComponentId;
231    }
232
233    /**
234     * Get Navigation Component Id
235     *
236     * @return string
237     */
238    public function getNavigationComponentId()
239    {
240        return $this->navigationComponentId;
241    }
242
243    /**
244     * @param string $navigationFrameScript
245     */
246    public function setNavigationFrameScript($navigationFrameScript)
247    {
248        $this->navigationFrameScript = $navigationFrameScript;
249    }
250
251    /**
252     * @return string
253     */
254    public function getNavigationFrameScript()
255    {
256        return $this->navigationFrameScript;
257    }
258
259    /**
260     * @param string $navigationFrameScriptParameters
261     */
262    public function setNavigationFrameScriptParameters($navigationFrameScriptParameters)
263    {
264        $this->navigationFrameScriptParameters = $navigationFrameScriptParameters;
265    }
266
267    /**
268     * @return string
269     */
270    public function getNavigationFrameScriptParameters()
271    {
272        return $this->navigationFrameScriptParameters;
273    }
274
275    /**
276     * Set onClick
277     *
278     * @param string $onClick
279     */
280    public function setOnClick($onClick)
281    {
282        $this->onClick = $onClick;
283    }
284
285    /**
286     * Get onClick
287     *
288     * @return string
289     */
290    public function getOnClick()
291    {
292        return $this->onClick;
293    }
294
295    public function setCollapsed(bool $collapsed): void
296    {
297        $this->collapsed = $collapsed;
298    }
299
300    public function getCollapsed(): bool
301    {
302        return $this->collapsed;
303    }
304
305    /**
306     * @return bool
307     */
308    public function isStandalone(): bool
309    {
310        return $this->standalone;
311    }
312
313    /**
314     * @param bool $standalone
315     */
316    public function setStandalone(bool $standalone): void
317    {
318        $this->standalone = $standalone;
319    }
320}
321