/** * @param array $unprocessedData * @param string $profileName * @param string $outputFile */ protected function afterImport(array $unprocessedData, $profileName, $outputFile) { //loads hidden profile for article $profile = $this->profileFactory->loadHiddenProfile($profileName); $fileWriter = $this->fileIOFactory->createFileWriter('csv'); $dataTransformerChain = $this->dataTransformerFactory->createDataTransformerChain($profile, ['isTree' => $fileWriter->hasTreeStructure()]); $dataWorkflow = new DataWorkflow(null, $profile, $dataTransformerChain, $fileWriter); $dataWorkflow->saveUnprocessedData($unprocessedData, $profileName, $outputFile); }
/** * Saves unprocessed data to csv file * * @param array $data * @param string $profileName * @param string $outputFile */ protected function afterImport($data, $profileName, $outputFile) { /** @var FileIOFactory $fileFactory */ $fileFactory = $this->Plugin()->getFileIOFactory(); //loads hidden profile for article /** @var Profile $profile */ $profile = $this->Plugin()->getProfileFactory()->loadHiddenProfile($profileName); $fileWriter = $fileFactory->createFileWriter('csv'); /** @var DataTransformerChain $dataTransformerChain */ $dataTransformerChain = $this->Plugin()->getDataTransformerFactory()->createDataTransformerChain($profile, array('isTree' => $fileWriter->hasTreeStructure())); $dataWorkflow = new DataWorkflow(null, $profile, $dataTransformerChain, $fileWriter); $dataWorkflow->saveUnprocessedData($data, $profileName, $outputFile); }