Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update explain sql query #413

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e-env/.env.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
COMPOSE_PROJECT_NAME=ps_eventbus
COMPOSE_PROFILES=localhost

# Infrastructure dependencies
DOCKER_IMAGE_PRESTASHOP=prestashop/prestashop-flashlight:latest
Expand Down
6 changes: 1 addition & 5 deletions src/Repository/BundleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CarrierDetailRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CarrierRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CarrierTaxeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CartProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
;

Expand Down
9 changes: 4 additions & 5 deletions src/Repository/CartRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CartRuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CategoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CurrencyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CustomProductCarrierRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/CustomerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/EmployeeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/ImageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/ImageTypeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/LanguageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/ManufacturerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/ModuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/OrderCarrierRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/OrderCartRuleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/OrderDetailRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
6 changes: 1 addition & 5 deletions src/Repository/OrderStatusHistoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;

Expand Down
4 changes: 0 additions & 4 deletions src/Repository/ProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/Repository/ProductSupplierRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
;

Expand Down
Loading
Loading