/** * Returns an array of file objects for the given UIDs of fileCollections * * @param array $collectionUids The uids * * @return array */ public function getFileObjectsFromCollection(array $collectionUids) { $imageItems = array(); foreach ($collectionUids as $collectionUid) { $collection = $this->fileCollectionRepository->findByUid($collectionUid); $collection->loadContents(); foreach ($collection->getItems() as $item) { if (get_class($item) === 'TYPO3\\CMS\\Core\\Resource\\FileReference') { array_push($imageItems, $this->getFileObjectFromFileReference($item)); } else { array_push($imageItems, $item); } } } return $this->sortFileObjects($imageItems); }
/** * load all collections from database * * @return true */ protected function loadCollectionsFromDb() { // check if there are any collections if (count($this->collectionIds) > 0) { // Get all existing collections foreach ($this->collectionIds as $uid) { $this->collections[] = $this->fileCollectionRepository->findByUid($uid); } // Load the records in each file collection foreach ($this->collections as $c) { $c->loadContents(); // load and set description of file collection which is not loaded by default $c->setDescription($this->getSysFileCollectionData($c->getIdentifier())); } } }