‪TYPO3CMS  ‪main
StaticFileCollection.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 
26 {
30  protected static ‪$type = 'static';
31 
35  protected static ‪$itemsCriteriaField = 'files';
36 
40  protected ‪$itemTableName = 'sys_file_reference';
41 
52  public function ‪loadContents()
53  {
54  $fileRepository = GeneralUtility::makeInstance(FileRepository::class);
55  $fileReferences = $fileRepository->findByRelation('sys_file_collection', 'files', $this->‪getIdentifier());
56  foreach ($fileReferences as $file) {
57  $this->‪add($file);
58  }
59  }
60 }
‪TYPO3\CMS\Core\Resource\Collection
Definition: AbstractFileCollection.php:16
‪TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection
Definition: AbstractFileCollection.php:28
‪TYPO3\CMS\Core\Resource\Collection\StaticFileCollection\loadContents
‪loadContents()
Definition: StaticFileCollection.php:49
‪TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection\add
‪add(FileInterface $data)
Definition: AbstractFileCollection.php:188
‪TYPO3\CMS\Core\Resource\FileRepository
Definition: FileRepository.php:40
‪TYPO3\CMS\Core\Resource\Collection\StaticFileCollection\$itemTableName
‪string $itemTableName
Definition: StaticFileCollection.php:37
‪TYPO3\CMS\Core\Resource\Collection\StaticFileCollection
Definition: StaticFileCollection.php:26
‪TYPO3\CMS\Core\Collection\AbstractRecordCollection\getIdentifier
‪int getIdentifier()
Definition: AbstractRecordCollection.php:271
‪TYPO3\CMS\Core\Resource\Collection\StaticFileCollection\$type
‪static string $type
Definition: StaticFileCollection.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\Resource\Collection\StaticFileCollection\$itemsCriteriaField
‪static string $itemsCriteriaField
Definition: StaticFileCollection.php:33