From 8120304f957d43006435fcea316b134b6737434c Mon Sep 17 00:00:00 2001 From: "John.R" Date: Wed, 12 Feb 2025 11:03:38 +0100 Subject: [PATCH 1/2] feat: add explain sql for incremental query --- src/Repository/BundleRepository.php | 6 +----- src/Repository/CarrierDetailRepository.php | 6 +----- src/Repository/CarrierRepository.php | 6 +----- src/Repository/CarrierTaxeRepository.php | 6 +----- src/Repository/CartProductRepository.php | 6 +----- src/Repository/CartRepository.php | 9 ++++----- src/Repository/CartRuleRepository.php | 6 +----- src/Repository/CategoryRepository.php | 6 +----- src/Repository/CurrencyRepository.php | 6 +----- src/Repository/CustomProductCarrierRepository.php | 6 +----- src/Repository/CustomerRepository.php | 6 +----- src/Repository/EmployeeRepository.php | 6 +----- src/Repository/ImageRepository.php | 6 +----- src/Repository/ImageTypeRepository.php | 6 +----- src/Repository/LanguageRepository.php | 6 +----- src/Repository/ManufacturerRepository.php | 6 +----- src/Repository/ModuleRepository.php | 6 +----- src/Repository/OrderCarrierRepository.php | 6 +----- src/Repository/OrderCartRuleRepository.php | 6 +----- src/Repository/OrderDetailRepository.php | 6 +----- src/Repository/OrderRepository.php | 6 +----- src/Repository/OrderStatusHistoryRepository.php | 6 +----- src/Repository/ProductRepository.php | 4 ---- src/Repository/ProductSupplierRepository.php | 6 +----- src/Repository/SpecificPriceRepository.php | 6 +----- src/Repository/StockMovementRepository.php | 6 +----- src/Repository/StockRepository.php | 6 +----- src/Repository/StoreRepository.php | 6 +----- src/Repository/SupplierRepository.php | 6 +----- src/Repository/TaxonomyRepository.php | 6 +----- src/Repository/TranslationRepository.php | 6 +----- src/Repository/WishlistProductRepository.php | 6 +----- src/Repository/WishlistRepository.php | 6 +----- src/Service/SynchronizationService.php | 6 +++--- 34 files changed, 38 insertions(+), 167 deletions(-) diff --git a/src/Repository/BundleRepository.php b/src/Repository/BundleRepository.php index a86c80a3..e1503ccd 100644 --- a/src/Repository/BundleRepository.php +++ b/src/Repository/BundleRepository.php @@ -95,14 +95,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('pac.id_product_pack IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('pac.id_product_pack IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CarrierDetailRepository.php b/src/Repository/CarrierDetailRepository.php index b3cf36ac..22dbbcc6 100644 --- a/src/Repository/CarrierDetailRepository.php +++ b/src/Repository/CarrierDetailRepository.php @@ -147,14 +147,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('ca.id_carrier IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('ca.id_carrier IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') // ->limit($limit) Sub shop content depend from another, temporary disabled ; diff --git a/src/Repository/CarrierRepository.php b/src/Repository/CarrierRepository.php index 3375cc76..2cc9c98c 100644 --- a/src/Repository/CarrierRepository.php +++ b/src/Repository/CarrierRepository.php @@ -114,14 +114,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('c.id_carrier IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('c.id_carrier IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit); return $this->runQuery(); diff --git a/src/Repository/CarrierTaxeRepository.php b/src/Repository/CarrierTaxeRepository.php index 2d702e9e..55efff36 100644 --- a/src/Repository/CarrierTaxeRepository.php +++ b/src/Repository/CarrierTaxeRepository.php @@ -114,14 +114,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('ca.id_carrier IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('ca.id_carrier IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') // ->limit($limit) Sub shop content depend from another, temporary disabled ; diff --git a/src/Repository/CartProductRepository.php b/src/Repository/CartProductRepository.php index b029ee5b..05cd163f 100644 --- a/src/Repository/CartProductRepository.php +++ b/src/Repository/CartProductRepository.php @@ -90,14 +90,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('cp.id_cart IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('cp.id_cart IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') // ->limit($limit) Sub shop content depend from another, temporary disabled ; diff --git a/src/Repository/CartRepository.php b/src/Repository/CartRepository.php index 6c867baa..b6a2ebab 100644 --- a/src/Repository/CartRepository.php +++ b/src/Repository/CartRepository.php @@ -69,6 +69,9 @@ public function generateFullQuery($langIso, $withSelecParameters) */ public function retrieveContentsForFull($offset, $limit, $langIso) { + /* dump('full'); + die; */ + $this->generateFullQuery($langIso, true); $this->query->limit((int) $limit, (int) $offset); @@ -88,14 +91,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('c.id_cart IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('c.id_cart IN(' . implode(',', array_map('intval', $contentIds ?: [-1] ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CartRuleRepository.php b/src/Repository/CartRuleRepository.php index f0841e45..8d65df34 100644 --- a/src/Repository/CartRuleRepository.php +++ b/src/Repository/CartRuleRepository.php @@ -119,14 +119,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('cr.id_cart_rule IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('cr.id_cart_rule IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CategoryRepository.php b/src/Repository/CategoryRepository.php index f162b69a..cbe62e95 100644 --- a/src/Repository/CategoryRepository.php +++ b/src/Repository/CategoryRepository.php @@ -108,14 +108,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('cs.id_category IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('cs.id_category IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CurrencyRepository.php b/src/Repository/CurrencyRepository.php index b85da292..f8c32e92 100644 --- a/src/Repository/CurrencyRepository.php +++ b/src/Repository/CurrencyRepository.php @@ -103,14 +103,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('c.id_currency IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('c.id_currency IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CustomProductCarrierRepository.php b/src/Repository/CustomProductCarrierRepository.php index ca7aded3..7035aa6b 100644 --- a/src/Repository/CustomProductCarrierRepository.php +++ b/src/Repository/CustomProductCarrierRepository.php @@ -84,14 +84,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('pc.id_carrier_reference IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('pc.id_carrier_reference IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/CustomerRepository.php b/src/Repository/CustomerRepository.php index d5e44aa4..7cb40d11 100644 --- a/src/Repository/CustomerRepository.php +++ b/src/Repository/CustomerRepository.php @@ -96,14 +96,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('c.id_customer IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('c.id_customer IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/EmployeeRepository.php b/src/Repository/EmployeeRepository.php index b09bb554..ab8db14d 100644 --- a/src/Repository/EmployeeRepository.php +++ b/src/Repository/EmployeeRepository.php @@ -110,14 +110,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('e.id_employee IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('e.id_employee IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/ImageRepository.php b/src/Repository/ImageRepository.php index b71d1d30..6a726fc9 100644 --- a/src/Repository/ImageRepository.php +++ b/src/Repository/ImageRepository.php @@ -94,14 +94,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('i.id_image IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('i.id_image IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/ImageTypeRepository.php b/src/Repository/ImageTypeRepository.php index 20bb86dc..afec7714 100644 --- a/src/Repository/ImageTypeRepository.php +++ b/src/Repository/ImageTypeRepository.php @@ -92,14 +92,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('it.id_image_type IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('it.id_image_type IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/LanguageRepository.php b/src/Repository/LanguageRepository.php index 4e292d27..bb8cba6c 100644 --- a/src/Repository/LanguageRepository.php +++ b/src/Repository/LanguageRepository.php @@ -99,14 +99,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('la.id_lang IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('la.id_lang IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/ManufacturerRepository.php b/src/Repository/ManufacturerRepository.php index 2e359bba..075ae828 100644 --- a/src/Repository/ManufacturerRepository.php +++ b/src/Repository/ManufacturerRepository.php @@ -103,14 +103,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('ma.id_manufacturer IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('ma.id_manufacturer IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/ModuleRepository.php b/src/Repository/ModuleRepository.php index 24b67193..07902db5 100644 --- a/src/Repository/ModuleRepository.php +++ b/src/Repository/ModuleRepository.php @@ -105,14 +105,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('m.id_module IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('m.id_module IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/OrderCarrierRepository.php b/src/Repository/OrderCarrierRepository.php index a5fe9b27..09230a1f 100644 --- a/src/Repository/OrderCarrierRepository.php +++ b/src/Repository/OrderCarrierRepository.php @@ -92,14 +92,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('oc.id_order_carrier IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('oc.id_order_carrier IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/OrderCartRuleRepository.php b/src/Repository/OrderCartRuleRepository.php index 2cda0547..6300cf67 100644 --- a/src/Repository/OrderCartRuleRepository.php +++ b/src/Repository/OrderCartRuleRepository.php @@ -94,14 +94,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('ocr.id_order_cart_rule IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('ocr.id_order_cart_rule IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/OrderDetailRepository.php b/src/Repository/OrderDetailRepository.php index 7f2a5c27..5663d2c2 100644 --- a/src/Repository/OrderDetailRepository.php +++ b/src/Repository/OrderDetailRepository.php @@ -117,14 +117,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('od.id_order_detail IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('od.id_order_detail IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/OrderRepository.php b/src/Repository/OrderRepository.php index 84c24b52..7daf2619 100644 --- a/src/Repository/OrderRepository.php +++ b/src/Repository/OrderRepository.php @@ -147,14 +147,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('o.id_order IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('o.id_order IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/OrderStatusHistoryRepository.php b/src/Repository/OrderStatusHistoryRepository.php index 989ea401..5e5ee2ce 100644 --- a/src/Repository/OrderStatusHistoryRepository.php +++ b/src/Repository/OrderStatusHistoryRepository.php @@ -101,14 +101,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('oh.id_order_history IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('oh.id_order_history IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/ProductRepository.php b/src/Repository/ProductRepository.php index db62159e..4746a51f 100644 --- a/src/Repository/ProductRepository.php +++ b/src/Repository/ProductRepository.php @@ -172,10 +172,6 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query diff --git a/src/Repository/ProductSupplierRepository.php b/src/Repository/ProductSupplierRepository.php index 3abe82d6..ff4539dc 100644 --- a/src/Repository/ProductSupplierRepository.php +++ b/src/Repository/ProductSupplierRepository.php @@ -90,14 +90,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('ps.id_product IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('ps.id_product IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') // ->limit($limit) Sub shop content depend from another, temporary disabled ; diff --git a/src/Repository/SpecificPriceRepository.php b/src/Repository/SpecificPriceRepository.php index ed21db9b..d41e1d87 100644 --- a/src/Repository/SpecificPriceRepository.php +++ b/src/Repository/SpecificPriceRepository.php @@ -108,14 +108,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('sp.id_specific_price IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('sp.id_specific_price IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/StockMovementRepository.php b/src/Repository/StockMovementRepository.php index 337b39f5..91dbc669 100644 --- a/src/Repository/StockMovementRepository.php +++ b/src/Repository/StockMovementRepository.php @@ -105,13 +105,9 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); - $this->query->where('sm.id_stock_mvt IN(' . implode(',', array_map('intval', $contentIds)) . ')'); + $this->query->where('sm.id_stock_mvt IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')'); return $this->runQuery(); } diff --git a/src/Repository/StockRepository.php b/src/Repository/StockRepository.php index 355581e6..2dad05b6 100644 --- a/src/Repository/StockRepository.php +++ b/src/Repository/StockRepository.php @@ -106,14 +106,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('sa.id_stock_available IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('sa.id_stock_available IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/StoreRepository.php b/src/Repository/StoreRepository.php index 8f3461b2..093d1756 100644 --- a/src/Repository/StoreRepository.php +++ b/src/Repository/StoreRepository.php @@ -121,14 +121,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('s.id_store IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('s.id_store IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/SupplierRepository.php b/src/Repository/SupplierRepository.php index 1b716a20..3b69e801 100644 --- a/src/Repository/SupplierRepository.php +++ b/src/Repository/SupplierRepository.php @@ -105,14 +105,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('su.id_supplier IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('su.id_supplier IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/TaxonomyRepository.php b/src/Repository/TaxonomyRepository.php index 53dab9fe..9d983051 100644 --- a/src/Repository/TaxonomyRepository.php +++ b/src/Repository/TaxonomyRepository.php @@ -92,14 +92,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('fbcm.id_category IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('fbcm.id_category IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/TranslationRepository.php b/src/Repository/TranslationRepository.php index cf483319..cd8184e1 100644 --- a/src/Repository/TranslationRepository.php +++ b/src/Repository/TranslationRepository.php @@ -94,14 +94,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('t.id_translation IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('t.id_translation IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Repository/WishlistProductRepository.php b/src/Repository/WishlistProductRepository.php index 01bc0f47..25e456fb 100644 --- a/src/Repository/WishlistProductRepository.php +++ b/src/Repository/WishlistProductRepository.php @@ -94,14 +94,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('wp.id_wishlist IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('wp.id_wishlist IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') // ->limit($limit) Sub shop content depend from another, temporary disabled ; diff --git a/src/Repository/WishlistRepository.php b/src/Repository/WishlistRepository.php index 25558cfa..a6ba9253 100644 --- a/src/Repository/WishlistRepository.php +++ b/src/Repository/WishlistRepository.php @@ -100,14 +100,10 @@ public function retrieveContentsForFull($offset, $limit, $langIso) */ public function retrieveContentsForIncremental($limit, $contentIds, $langIso) { - if ($contentIds == []) { - return []; - } - $this->generateFullQuery($langIso, true); $this->query - ->where('w.id_wishlist IN(' . implode(',', array_map('intval', $contentIds)) . ')') + ->where('w.id_wishlist IN(' . implode(',', array_map('intval', $contentIds ?: [-1])) . ')') ->limit($limit) ; diff --git a/src/Service/SynchronizationService.php b/src/Service/SynchronizationService.php index 1dcf797f..d913b21d 100644 --- a/src/Service/SynchronizationService.php +++ b/src/Service/SynchronizationService.php @@ -184,13 +184,13 @@ public function sendIncrementalSync( $contentsToSync = $this->incrementalSyncRepository->getIncrementalSyncObjects($shopContent, $langIso, $limit); - if (empty($contentsToSync)) { + /* if (empty($contentsToSync)) { return [ 'total_objects' => 0, 'has_remaining_objects' => false, 'remaining_objects' => 0, ]; - } + } */ $upsertedContents = array_filter($contentsToSync, function ($content) { return $content['action'] == Config::INCREMENTAL_TYPE_UPSERT; @@ -201,7 +201,7 @@ public function sendIncrementalSync( }); $data = $shopContentApiService->getContentsForIncremental($limit, $upsertedContents, $deletedContents, $langIso); - + CommonService::convertDateFormat($data); if (!empty($data)) { From a4579fe998bea6b1ab9588b0c5cad07251d9cd57 Mon Sep 17 00:00:00 2001 From: "John.R" Date: Tue, 18 Feb 2025 17:08:21 +0100 Subject: [PATCH 2/2] chore: add env var for profiles --- e2e-env/.env.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e-env/.env.dist b/e2e-env/.env.dist index d713ea4c..3dc88dd0 100644 --- a/e2e-env/.env.dist +++ b/e2e-env/.env.dist @@ -1,4 +1,5 @@ COMPOSE_PROJECT_NAME=ps_eventbus +COMPOSE_PROFILES=localhost # Infrastructure dependencies DOCKER_IMAGE_PRESTASHOP=prestashop/prestashop-flashlight:latest