7210ced11f0d48806b1c08a9c039f46bf4137aff
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Domain / Model / ConfigurationSubcategory.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Domain\Model;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2012-2013 Susanne Moog, <typo3@susannemoog.de>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the text file GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29
30 /**
31 * Model for configuration sub categories
32 *
33 * Configuration options can be structured with categories and sub categories.
34 * Categories are usually displayed as tabs and sub categories are used to
35 * group configuration items in one tab.
36 *
37 * @author Susanne Moog <typo3@susannemoog.de>
38 */
39 class ConfigurationSubcategory extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
40
41 /**
42 * @var string
43 */
44 protected $name = '';
45
46 /**
47 * @var string The sub category label
48 */
49 protected $label = '';
50
51 /**
52 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem>
53 */
54 protected $items;
55
56 /**
57 * Constructs this Category
58 */
59 public function __construct() {
60 $this->items = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
61 }
62
63 /**
64 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $items
65 * @return void
66 */
67 public function setItems($items) {
68 $this->items = $items;
69 }
70
71 /**
72 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
73 */
74 public function getItems() {
75 return $this->items;
76 }
77
78 /**
79 * Adds a subcategory
80 *
81 * @param \TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $item
82 * @return void
83 */
84 public function addItem(\TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $item) {
85 $this->items->attach($item);
86 }
87
88 /**
89 * @param string $name
90 * @return void
91 */
92 public function setName($name) {
93 $this->name = $name;
94 }
95
96 /**
97 * @return string
98 */
99 public function getName() {
100 return $this->name;
101 }
102
103 /**
104 * Set sub category label
105 *
106 * @param string $label
107 * @return void
108 */
109 public function setLabel($label) {
110 $this->label = $label;
111 }
112
113 /**
114 * Get sub category label
115 *
116 * @return string
117 */
118 public function getLabel() {
119 return $this->label;
120 }
121
122 }