[TASK] Re-work/simplify copyright header in PHP files - Part 2
[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 * @entity
21 * @author Xavier Perseguers <xavier@typo3.org>
22 * @author Andrea Schmuttermair <spam@schmutt.de>
23 */
24 class DocumentTranslation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
25
26 /**
27 * language
28 * 2 char language identifier (or "" for default)
29 *
30 * @var string
31 * @validate NotEmpty
32 */
33 protected $language;
34
35 /**
36 * title
37 *
38 * @var string
39 */
40 protected $title;
41
42 /**
43 * description
44 *
45 * @var string
46 */
47 protected $description;
48
49 /**
50 * formats
51 *
52 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat>
53 */
54 protected $formats;
55
56 /**
57 * Default constructor.
58 */
59 public function __construct() {
60 // Do not remove the next line: It would break the functionality
61 $this->initStorageObjects();
62 }
63
64 /**
65 * Initializes all ObjectStorage properties.
66 *
67 * @return void
68 */
69 protected function initStorageObjects() {
70 /**
71 * Do not modify this method!
72 * It will be rewritten on each save in the extension builder
73 * You may modify the constructor of this class instead
74 */
75 $this->formats = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
76 }
77
78 /**
79 * Returns the language.
80 *
81 * @return string $language
82 */
83 public function getLanguage() {
84 return $this->language;
85 }
86
87 /**
88 * Sets the language.
89 *
90 * @param string $language
91 * @return DocumentTranslation
92 */
93 public function setLanguage($language) {
94 $this->language = $language;
95 return $this;
96 }
97
98 /**
99 * Returns the title.
100 *
101 * @return string $title
102 */
103 public function getTitle() {
104 return $this->title;
105 }
106
107 /**
108 * Sets the title.
109 *
110 * @param string $title
111 * @return DocumentTranslation
112 */
113 public function setTitle($title) {
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 return $this->description;
125 }
126
127 /**
128 * Sets the description.
129 *
130 * @param string $description
131 * @return DocumentTranslation
132 */
133 public function setDescription($description) {
134 $this->description = $description;
135 return $this;
136 }
137
138 /**
139 * Adds a documentation format.
140 *
141 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format
142 * @return DocumentTranslation
143 */
144 public function addFormat(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $format) {
145 $this->formats->attach($format);
146 return $this;
147 }
148
149 /**
150 * Removes a documentation format.
151 *
152 * @param \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $formatToRemove The DocumentFormat to be removed
153 * @return DocumentTranslation
154 */
155 public function removeFormat(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $formatToRemove) {
156 $this->formats->detach($formatToRemove);
157 return $this;
158 }
159
160 /**
161 * Returns the formats.
162 *
163 * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat> $formats
164 */
165 public function getFormats() {
166 return $this->formats;
167 }
168
169 /**
170 * Sets the formats.
171 *
172 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat> $formats
173 * @return DocumentTranslation
174 */
175 public function setFormats(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $formats) {
176 $this->formats = $formats;
177 return $this;
178 }
179
180 }