[TASK] Re-work/simplify copyright header in PHP files - Part 2
[Packages/TYPO3.CMS.git] / typo3 / sysext / documentation / Classes / Domain / Model / Document.php
1 <?php
2 namespace TYPO3\CMS\Documentation\Domain\Model;
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 * An extension helper model to be used in ext:documentation context
19 *
20 * @entity
21 * @author Andrea Schmuttermair <spam@schmutt.de>
22 */
23 class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
24
25 /**
26 * packageKey
27 *
28 * @var string
29 * @validate NotEmpty
30 */
31 protected $packageKey;
32
33 /**
34 * extensionKey
35 *
36 * @var string
37 * @validate NotEmpty
38 */
39 protected $extensionKey;
40
41 /**
42 * icon
43 *
44 * @var string
45 */
46 protected $icon;
47
48 /**
49 * translations
50 *
51 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation>
52 */
53 protected $translations;
54
55 /**
56 * Default constructor.
57 */
58 public function __construct() {
59 // Do not remove the next line: It would break the functionality
60 $this->initStorageObjects();
61 }
62
63 /**
64 * Initializes all ObjectStorage properties.
65 *
66 * @return void
67 */
68 protected function initStorageObjects() {
69 /**
70 * Do not modify this method!
71 * It will be rewritten on each save in the extension builder
72 * You may modify the constructor of this class instead
73 */
74 $this->translations = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
75 }
76
77 /**
78 * Returns the package key.
79 *
80 * @return string $packageKey
81 */
82 public function getPackageKey() {
83 return $this->packageKey;
84 }
85
86 /**
87 * Sets the package key.
88 *
89 * @param string $packageKey
90 * @return Document
91 */
92 public function setPackageKey($packageKey) {
93 $this->packageKey = $packageKey;
94 return $this;
95 }
96
97 /**
98 * Returns the extension key.
99 *
100 * @return string $extensionKey
101 */
102 public function getExtensionKey() {
103 return $this->extensionKey;
104 }
105
106 /**
107 * Sets the extension key.
108 *
109 * @param string $extensionKey
110 * @return Document
111 */
112 public function setExtensionKey($extensionKey) {
113 $this->extensionKey = $extensionKey;
114 return $this;
115 }
116
117 /**
118 * Returns the icon.
119 *
120 * @return string $icon
121 */
122 public function getIcon() {
123 return $this->icon;
124 }
125
126 /**
127 * Sets the icon.
128 *
129 * @param string $icon
130 * @return Document
131 */
132 public function setIcon($icon) {
133 $this->icon = $icon;
134 return $this;
135 }
136
137 /**
138 * Adds a document translation.
139 *
140 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $translation
141 * @return Document
142 */
143 public function addTranslation(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $translation) {
144 $this->translations->attach($translation);
145 return $this;
146 }
147
148 /**
149 * Removes a document translation.
150 *
151 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $translationToRemove The DocumentTranslation to be removed
152 * @return Document
153 */
154 public function removeTranslation(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $translationToRemove) {
155 $this->translations->detach($translationToRemove);
156 return $this;
157 }
158
159 /**
160 * Returns the translations.
161 *
162 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation> $translations
163 */
164 public function getTranslations() {
165 return $this->translations;
166 }
167
168 /**
169 * Sets the translations.
170 *
171 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation> $translations
172 * @return Document
173 */
174 public function setTranslations(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $translations) {
175 $this->translations = $translations;
176 return $this;
177 }
178
179 }