[TYPO3-dev] hot to create a collection programatically and add files to it
Pierre N.
droomdre at yahoo.de
Wed Jun 1 09:54:58 CEST 2016
Hello folks,
i'm trying to create a collection like this but it didn't work. I got no error message but nothing wrote in the DB
$collection_array= array("type"=>"static","uid"=>4,"title"=>"test","table_name"=>"sys_file_collection","description"=>"my description");
$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$fileRepository = $this->objectManager->get('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
$file = $fileRepository->createCollectionObject($collection_array);
how can i achieve this?
More information about the TYPO3-dev
mailing list