2 namespace TYPO3\CMS\Frontend\Resource;
69 public function addFiles(array $fileUids = array())
71 if (!empty($fileUids)) {
72 foreach ($fileUids as $fileUid) {
77 'The file with uid "' . $fileUid
78 .
'" could not be found and won\'t be included in frontend output',
79 array(
'exception' => $e)
97 $fileReferences =
$GLOBALS[
'TSFE']->sys_page->getFileReferences($relationTable, $relationField, $referenceRecord);
99 $fileReferences = $this->
getFileRepository()->findByRelation($relationTable, $relationField, $referenceRecord[
'uid']);
102 if (!empty($fileReferences)) {
115 foreach ($fileReferenceUids as $fileReferenceUid) {
116 $fileObject = $this->
getFileRepository()->findFileReferenceByUid($fileReferenceUid);
129 foreach ($fileCollectionUids as $fileCollectionUid) {
142 if (!empty($fileCollectionUid)) {
146 if ($fileCollection instanceof \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection) {
147 $fileCollection->loadContents();
148 $files = $fileCollection->getItems();
154 'The file-collection with uid "' . $fileCollectionUid
155 .
'" could not be found or contents could not be loaded and won\'t be included in frontend output.',
156 array(
'exception' => $e)
171 foreach ($folderIdentifiers as $folderIdentifier) {
184 if ($folderIdentifier) {
186 $folder = $this->
getResourceFactory()->getFolderObjectFromCombinedIdentifier($folderIdentifier);
187 if ($folder instanceof
Folder) {
193 'The folder with identifier "' . $folderIdentifier
194 .
'" could not be found and won\'t be included in frontend output',
195 array(
'exception' => $e)
208 public function sort($sortingProperty =
'', $sortingOrder =
'ascending')
210 if ($sortingProperty !==
'' &&
count($this->files) > 1) {
216 ) use ($sortingProperty) {
225 switch (strtolower($sortingOrder)) {
228 $this->files = array_reverse($this->files);
232 shuffle($this->files);
246 $this->files[] = $file;
257 $this->files = array_merge($this->files,
$files);
275 return count($this->files);
291 if ($this->resourceFactory === null) {
302 if ($this->fileCollectionRepository === null) {
313 if ($this->fileRepository === null) {