From ac2e2ce12b3a355c1eeb853a7bc833d8525bf215 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 18 Oct 2020 22:43:36 +0200 Subject: [PATCH] start adding image import --- Interfaces/GSD/Importer.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Interfaces/GSD/Importer.php b/Interfaces/GSD/Importer.php index 5c02fc2..b31de9e 100755 --- a/Interfaces/GSD/Importer.php +++ b/Interfaces/GSD/Importer.php @@ -150,7 +150,7 @@ final class Importer extends ImporterAbstract } if (((bool) ($request->getData('articles') ?? false))) { - $this->importArticle($start, $end); + $this->importArticle($start, $end, $request->getFiles()); } if (((bool) ($request->getData('invoices') ?? false))) { @@ -397,14 +397,15 @@ final class Importer extends ImporterAbstract /** * Import articles * - * @param \DateTime $start Start time (inclusive) - * @param \DateTime $end End time (inclusive) + * @param \DateTime $start Start time (inclusive) + * @param \DateTime $end End time (inclusive) + * @param array $images Article images * * @return void * * @since 1.0.0 */ - public function importArticle(\DateTime $start, \DateTime $end) : void + public function importArticle(\DateTime $start, \DateTime $end, array $images = []) : void { DataMapperAbstract::setConnection($this->remote); $query = GSDArticleMapper::getQuery(); @@ -465,6 +466,10 @@ final class Importer extends ImporterAbstract ISO639x1Enum::_EN )); + // @todo: implement + // api upload media + //$obj->addMedia(); + ItemMapper::create($obj); } }