From f6a46012a79b534a7d0d294461730b91ebe73126 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 13 Aug 2019 10:10:00 +0200 Subject: [PATCH] Make Pid of categories configurable --- Classes/Service/DestinationDataImportService.php | 6 ++++++ Configuration/TypoScript/constants.typoscript | 2 ++ Configuration/TypoScript/setup.typoscript | 1 + 3 files changed, 9 insertions(+) diff --git a/Classes/Service/DestinationDataImportService.php b/Classes/Service/DestinationDataImportService.php index 58a09f2..7ba84d0 100644 --- a/Classes/Service/DestinationDataImportService.php +++ b/Classes/Service/DestinationDataImportService.php @@ -52,6 +52,10 @@ class DestinationDataImportService { * @var */ protected $storagePid; + /** + * @var + */ + protected $categoriesPid; /** * @var */ @@ -184,6 +188,7 @@ class DestinationDataImportService { $this->restType = $this->settings['destinationData']['restType']; $this->restLimit = $this->settings['destinationData']['restLimit']; $this->restTemplate = $this->settings['destinationData']['dataTemplate']; + $this->sysCategoriesPid = $this->settings['destinationData']['categoriesPid']; } /** @@ -289,6 +294,7 @@ class DestinationDataImportService { $tmpSysCategory = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Model\\Category'); $tmpSysCategory->setTitle($categoryTitle); $tmpSysCategory->setParent($sysParentCategory); + $tmpSysCategory->setPid($this->sysCategoriesPid); $this->sysCategoriesRepository->add($tmpSysCategory); $this->tmpCurrentEvent->addCategory($tmpSysCategory); } else { diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 9fb227e..c6ea1d3 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -24,6 +24,8 @@ plugin.tx_events { dataLimit = 200 # cat=plugin.tx_events//a; type=string; label=Data Template dataTemplate = ET2014A.json + # cat.plugin.tx_events//a; type=string: Label=Category Storage + categoriesPid = 54 } } } diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index 0cade83..894abef 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -51,6 +51,7 @@ plugin.tx_events { dataType = {$plugin.tx_events.settings.destinationData.datType} dataLimit = {$plugin.tx_events.settings.destinationData.dataLimit} dataTemplate = {$plugin.tx_events.settings.destinationData.dataTemplate} + categoriesPid = {$plugin.tx_events.settings.destinationData.categoriesPid} } } }