/** * Creates a new album and imports images from zip into that album * * TODO this method is not yet used and hence not tested! * * @param Tx_Yag_Domain_Model_Gallery $gallery Gallery to add album to * @param string $albumName Name of album to be created * @throws Exception */ public function createNewAlbumAndImportFromZipAction(Tx_Yag_Domain_Model_Gallery $gallery, $albumName) { $album = new Tx_Yag_Domain_Model_Album(); $album->setName($albumName); $album->addGallery($gallery); $gallery->addAlbum($album); $this->albumRepository->add($album); $persistenceManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager'); $persistenceManager->persistAll(); if (!$album->getUid() > 0) { throw new Exception('Album hat keine UID!'); } $importer = Tx_Yag_Domain_Import_ZipImporter_ImporterBuilder::getInstance()->getZipImporterInstanceForAlbum($album); $importer->runImport(); $this->view->assign('album', $album); }