[BUGFIX] FAL: Image Processing doesn't respect GFX "thumbnails_png"
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Collection / StaticFileCollection.php
1 <?php
2 namespace TYPO3\CMS\Core\Resource\Collection;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2011-2013 Andreas Wolf <andreas.wolf@ikt-werk.de>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * A collection containing a static set of files. This collection is persisted
31 * to the database with references to all files it contains.
32 *
33 * @author Andreas Wolf <andreas.wolf@ikt-werk.de>
34 */
35 class StaticFileCollection extends \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection {
36
37 /**
38 * @var string
39 */
40 static protected $type = 'static';
41
42 /**
43 * @var string
44 */
45 static protected $itemsCriteriaField = 'items';
46
47 /**
48 * @var string
49 */
50 protected $itemTableName = 'sys_file_reference';
51
52 /**
53 * Populates the content-entries of the storage
54 *
55 * Queries the underlying storage for entries of the collection
56 * and adds them to the collection data.
57 *
58 * If the content entries of the storage had not been loaded on creation
59 * ($fillItems = false) this function is to be used for loading the contents
60 * afterwards.
61 *
62 * @return void
63 */
64 public function loadContents() {
65 /** @var \TYPO3\CMS\Core\Resource\FileRepository $fileRepository */
66 $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
67 $fileReferences = $fileRepository->findByRelation('sys_file_collection', 'files', $this->getIdentifier());
68 foreach ($fileReferences as $file) {
69 $this->add($file);
70 }
71 }
72
73 }
74
75
76 ?>