From aabbf30e5ddc2286019857a3def0372d4bcdfa19 Mon Sep 17 00:00:00 2001 From: Timo Ebel Date: Thu, 4 Apr 2024 14:27:07 +0200 Subject: [PATCH] Code style. --- src/Backend/SgateShopgatePlugin/Plugin.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Backend/SgateShopgatePlugin/Plugin.php b/src/Backend/SgateShopgatePlugin/Plugin.php index b480ade..e5c7c20 100644 --- a/src/Backend/SgateShopgatePlugin/Plugin.php +++ b/src/Backend/SgateShopgatePlugin/Plugin.php @@ -5331,16 +5331,20 @@ protected function createItems($limit = null, $offset = null, array $uids = arra $list = $this->getExportArticles($limit, $offset, $uids); $logMessage = 'Articles from DB: ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode(array_map(function ($article) { - if ($article['id'] == 5568) $this->log('Found it! ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode($article), ShopgateLogger::LOGTYPE_ACCESS); - return ['id' => $article['id'], 'mainDetailId' => $article['mainDetailId']]; - }, $list)); + if ($article['id'] == 5568) { + $this->log('Found it! ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode($article), ShopgateLogger::LOGTYPE_ACCESS); + } + return ['id' => $article['id'], 'mainDetailId' => $article['mainDetailId']]; + }, $list)); $this->log($logMessage, ShopgateLogger::LOGTYPE_ACCESS); $articles = $this->eventManager->filter('sgate.export.items.createItems.article_load_after', $list, ['data' => $list]); $logMessage = 'Articles after filter: ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode(array_map(function ($article) { - if ($article['id'] == 5568) $this->log('Found it (filtered)! ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode($article), ShopgateLogger::LOGTYPE_ACCESS); - return ['id' => $article['id'], 'mainDetailId' => $article['mainDetailId']]; - }, $articles)); + if ($article['id'] == 5568) { + $this->log('Found it (filtered)! ' . $this->getHelper(self::HELPER_DATASTRUCTURE)->jsonEncode($article), ShopgateLogger::LOGTYPE_ACCESS); + } + return ['id' => $article['id'], 'mainDetailId' => $article['mainDetailId']]; + }, $articles)); $this->log($logMessage, ShopgateLogger::LOGTYPE_ACCESS); $this->log(