[CLEANUP] Remove/Replace non-standard phpdoc annotations
[Packages/TYPO3.CMS.git] / typo3 / sysext / documentation / Classes / Domain / Model / DocumentTranslation.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 DocumentTranslation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
21 {
22 /**
23 * language
24 * 2 char language identifier (or "" for default)
25 *
26 * @var string
27 * @validate NotEmpty
28 */
29 protected $language;
30
31 /**
32 * title
33 *
34 * @var string
35 */
36 protected $title;
37
38 /**
39 * description
40 *
41 * @var string
42 */
43 protected $description;
44
45 /**
46 * formats
47 *
48 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat>
49 */
50 protected $formats;
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->formats = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
72 }
73
74 /**
75 * Returns the language.
76 *
77 * @return string $language
78 */
79 public function getLanguage()
80 {
81 return $this->language;
82 }
83
84 /**
85 * Sets the language.
86 *
87 * @param string $language
88 * @return DocumentTranslation
89 */
90 public function setLanguage($language)
91 {
92 $this->language = $language;
93 return $this;
94 }
95
96 /**
97 * Returns the title.
98 *
99 * @return string $title
100 */
101 public function getTitle()
102 {
103 return $this->title;
104 }
105
106 /**
107 * Sets the title.
108 *
109 * @param string $title
110 * @return DocumentTranslation
111 */
112 public function setTitle($title)
113 {
114 $this->title = $title;
115 return $this;
116 }
117
118 /**
119 * Returns the description.
120 *
121 * @return string $description
122 */
123 public function getDescription()
124 {
125 return $this->description;
126 }
127
128 /**
129 * Sets the description.
130 *
131 * @param string $description
132 * @return DocumentTranslation
133 */
134 public function setDescription($description)
135 {
136 $this->description = $description;
137 return $this;
138 }
139
140 /**
141 * Adds a documentation format.
142 *
143 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format
144 * @return DocumentTranslation
145 */
146 public function addFormat(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format)
147 {
148 $this->formats->attach($format);
149 return $this;
150 }
151
152 /**
153 * Removes a documentation format.
154 *
155 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $formatToRemove The DocumentFormat to be removed
156 * @return DocumentTranslation
157 */
158 public function removeFormat(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $formatToRemove)
159 {
160 $this->formats->detach($formatToRemove);
161 return $this;
162 }
163
164 /**
165 * Returns the formats.
166 *
167 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat> $formats
168 */
169 public function getFormats()
170 {
171 return $this->formats;
172 }
173
174 /**
175 * Sets the formats.
176 *
177 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat> $formats
178 * @return DocumentTranslation
179 */
180 public function setFormats(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $formats)
181 {
182 $this->formats = $formats;
183 return $this;
184 }
185 }