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