[TYPO3-mvc] extbase way of accessing folder based file collection
Domi
djgarms at gmail.com
Sun Jun 23 06:32:52 CEST 2013
Hi Frans
>
> /**
> * @param $uid collection uid from flexform
> *
> * @return array|void
> */
> protected function getFileCollectionItems($uid) {
> /** @var $fileCollection
> \TYPO3\CMS\Core\Resource\**Collection\**AbstractFileCollection */
> $fileCollection = $this->fileCollectionRepository->findByUid($uid);
> $fileCollection->loadContents();
> $items = $fileCollection->getItems();
>
> foreach ($items as $item) {
> /** @var FileReference $item */
> $files[] = $item->toArray();
> }
>
> return $files;
> }
>
I did this and it works!
> so this will not work:
>
> $fileCollection->loadContents();
> $items = $fileCollection->getItems();
>
> return $fileCollection->loadContents();
This doesn't work for the FolderBasedFileCollection. I tried all options
but items always remain empty.
Any ideas why it's not working?
Thanks,
Dominic
More information about the TYPO3-project-typo3v4mvc
mailing list