v:var.set(name: 'someCollection')} * * @category ViewHelpers * @package Vhs * @author Dmitri Pisarev */ class CollectionViewHelper extends AbstractResourceViewHelper { /** * @var RecordCollectionRepository */ protected $collectionRepository; /** * @param RecordCollectionRepository $collectionRepository * @return void */ public function injectCollectionRepository(RecordCollectionRepository $collectionRepository) { $this->collectionRepository = $collectionRepository; } /** * Returns a specific collection referenced by uid. * * @param integer $uid * @return mixed */ public function render($uid) { if (NULL !== $uid) { /** @var \TYPO3\CMS\Core\Collection\AbstractRecordCollection $collection */ $collection = $this->collectionRepository->findByUid($uid); if (NULL !== $collection) { return $collection->loadContents(); } else { return NULL; } } return NULL; } }