[FEATURE] Integrate basic file abstraction layer models
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Functional / Domain / Model / Fixture / FileContext.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2012 Oliver Hader <oliver.hader@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * A file context object (File Abstraction Layer)
27 *
28 * @package Extbase
29 * @subpackage Domain\Model
30 * @scope prototype
31 * @entity
32 * @api
33 */
34 class Tx_Extbase_Tests_Functional_Domain_Model_Fixture_FileContext extends Tx_Extbase_DomainObject_AbstractEntity {
35 /**
36 * @var Tx_Extbase_Domain_Model_File
37 */
38 protected $file;
39
40 /**
41 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File>
42 */
43 protected $files;
44
45 /**
46 * @var Tx_Extbase_Domain_Model_FileReference
47 */
48 protected $fileReference;
49
50 /**
51 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference>
52 */
53 protected $fileReferences;
54
55 /**
56 * @var Tx_Extbase_Domain_Model_StaticFileCollection
57 */
58 protected $staticFileCollection;
59
60 /**
61 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection>
62 */
63 protected $staticFileCollections;
64
65 /**
66 * @var Tx_Extbase_Domain_Model_FolderBasedFileCollection
67 */
68 protected $folderBasedFileCollection;
69
70 /**
71 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection>
72 */
73 protected $folderBasedFileCollections;
74
75 /**
76 * @var Tx_Extbase_Domain_Model_Folder
77 */
78 protected $folder;
79
80 /**
81 * @var Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder>
82 */
83 protected $folders;
84
85 public function __construct() {
86 $this->files = new Tx_Extbase_Persistence_ObjectStorage();
87 $this->fileReferences = new Tx_Extbase_Persistence_ObjectStorage();
88 $this->staticFileCollections = new Tx_Extbase_Persistence_ObjectStorage();
89 $this->folderBasedFileCollections = new Tx_Extbase_Persistence_ObjectStorage();
90 $this->folders = new Tx_Extbase_Persistence_ObjectStorage();
91 }
92
93 /**
94 * FILE
95 */
96
97 /**
98 * @return Tx_Extbase_Domain_Model_File
99 */
100 public function getFile() {
101 return $this->file;
102 }
103
104 /**
105 * @param Tx_Extbase_Domain_Model_File $file
106 */
107 public function setFile(Tx_Extbase_Domain_Model_File $file) {
108 $this->file = $file;
109 }
110
111 /**
112 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File>
113 */
114 public function getFiles() {
115 return $this->files;
116 }
117
118 /**
119 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_File> $files
120 */
121 public function setFiles(Tx_Extbase_Persistence_ObjectStorage $files) {
122 $this->files = $files;
123 }
124
125 /**
126 * @param Tx_Extbase_Domain_Model_File $file
127 */
128 public function addFile(Tx_Extbase_Domain_Model_File $file) {
129 $this->files->attach($file);
130 }
131
132 /**
133 * @param Tx_Extbase_Domain_Model_File $file
134 */
135 public function removeFile(Tx_Extbase_Domain_Model_File $file) {
136 $this->files->detach($file);
137 }
138
139 /**
140 * COLLECTION
141 */
142
143 /**
144 * @return Tx_Extbase_Domain_Model_StaticFileCollection
145 */
146 public function getStaticFileCollection() {
147 return $this->staticFileCollection;
148 }
149
150 /**
151 * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
152 */
153 public function setStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
154 $this->staticFileCollection = $staticFileCollection;
155 }
156
157 /**
158 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection>
159 */
160 public function getStaticFileCollections() {
161 return $this->staticFileCollections;
162 }
163
164 /**
165 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_StaticFileCollection> $staticFileCollections
166 */
167 public function setStaticFileCollections(Tx_Extbase_Persistence_ObjectStorage $staticFileCollections) {
168 $this->staticFileCollections = $staticFileCollections;
169 }
170
171 /**
172 * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
173 */
174 public function addStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
175 $this->staticFileCollections->attach($staticFileCollection);
176 }
177
178 /**
179 * @param Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection
180 */
181 public function removeStaticFileCollection(Tx_Extbase_Domain_Model_StaticFileCollection $staticFileCollection) {
182 $this->staticFileCollections->detach($staticFileCollection);
183 }
184
185 /**
186 * @return Tx_Extbase_Domain_Model_FolderBasedFileCollection
187 */
188 public function getFolderBasedFileCollection() {
189 return $this->folderBasedFileCollection;
190 }
191
192 /**
193 * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
194 */
195 public function setFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
196 $this->folderBasedFileCollection = $folderBasedFileCollection;
197 }
198
199 /**
200 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection>
201 */
202 public function getFolderBasedFileCollections() {
203 return $this->folderBasedFileCollections;
204 }
205
206 /**
207 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FolderBasedFileCollection> $folderBasedFileCollections
208 */
209 public function setFolderBasedFileCollections(Tx_Extbase_Persistence_ObjectStorage $folderBasedFileCollections) {
210 $this->folderBasedFileCollections = $folderBasedFileCollections;
211 }
212
213 /**
214 * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
215 */
216 public function addFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
217 $this->folderBasedFileCollections->attach($folderBasedFileCollection);
218 }
219
220 /**
221 * @param Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection
222 */
223 public function removeFolderBasedFileCollection(Tx_Extbase_Domain_Model_FolderBasedFileCollection $folderBasedFileCollection) {
224 $this->folderBasedFileCollections->detach($folderBasedFileCollection);
225 }
226
227 /**
228 * REFERENCE
229 */
230
231 /**
232 * @return Tx_Extbase_Domain_Model_FileReference
233 */
234 public function getFileReference() {
235 return $this->fileReference;
236 }
237
238 /**
239 * @param Tx_Extbase_Domain_Model_FileReference $fileReference
240 */
241 public function setFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
242 $this->fileReference = $fileReference;
243 }
244
245 /**
246 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference>
247 */
248 public function getFileReferences() {
249 return $this->fileReferences;
250 }
251
252 /**
253 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_FileReference> $fileReferences
254 */
255 public function setFileReferences(Tx_Extbase_Persistence_ObjectStorage $fileReferences) {
256 $this->fileReferences = $fileReferences;
257 }
258
259 /**
260 * @param Tx_Extbase_Domain_Model_FileReference $fileReference
261 */
262 public function addFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
263 $this->fileReferences->attach($fileReference);
264 }
265
266 /**
267 * @param Tx_Extbase_Domain_Model_FileReference $fileReference
268 */
269 public function removeFileReference(Tx_Extbase_Domain_Model_FileReference $fileReference) {
270 $this->fileReferences->detach($fileReference);
271 }
272
273 /**
274 * FOLDER
275 */
276
277 /**
278 * @return Tx_Extbase_Domain_Model_Folder
279 */
280 public function getFolder() {
281 return $this->folder;
282 }
283
284 /**
285 * @param Tx_Extbase_Domain_Model_Folder $folder
286 */
287 public function setFolder(Tx_Extbase_Domain_Model_Folder $folder) {
288 $this->folder = $folder;
289 }
290
291 /**
292 * @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder>
293 */
294 public function getFolders() {
295 return $this->folders;
296 }
297
298 /**
299 * @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_Domain_Model_Folder> $folders
300 */
301 public function setFolders(Tx_Extbase_Persistence_ObjectStorage $folders) {
302 $this->folders = $folders;
303 }
304
305 /**
306 * @param Tx_Extbase_Domain_Model_Folder $folder
307 */
308 public function addFolder(Tx_Extbase_Domain_Model_Folder $folder) {
309 $this->folders->attach($folder);
310 }
311
312 /**
313 * @param Tx_Extbase_Domain_Model_Folder $folder
314 */
315 public function removeFolder(Tx_Extbase_Domain_Model_Folder $folder) {
316 $this->folders->detach($folder);
317 }
318 }
319 ?>