Browse Source

AbstractStore : resetContext()

packProduct
Guillaume 3 years ago
parent
commit
04abdf97c1
61 changed files with 114 additions and 59 deletions
  1. +2
    -0
      Container/Address/AddressContainer.php
  2. +2
    -0
      Container/Config/TaxRateContainer.php
  3. +2
    -0
      Container/Credit/CreditHistoryContainer.php
  4. +2
    -0
      Container/File/DocumentContainer.php
  5. +2
    -0
      Container/Order/OrderShopContainer.php
  6. +2
    -0
      Container/PointSale/PointSaleContainer.php
  7. +2
    -0
      Container/Product/ProductCategoryContainer.php
  8. +2
    -0
      Container/Product/ProductContainer.php
  9. +2
    -0
      Container/Product/ProductFamilyContainer.php
  10. +2
    -0
      Container/Product/ProductFamilySectionPropertyContainer.php
  11. +2
    -0
      Container/Reduction/ReductionCartContainer.php
  12. +2
    -0
      Container/Reduction/ReductionCatalogContainer.php
  13. +2
    -0
      Container/Section/OpeningContainer.php
  14. +2
    -0
      Container/Section/SectionContainer.php
  15. +2
    -0
      Container/Setting/MerchantSettingContainer.php
  16. +2
    -0
      Container/Setting/SectionSettingContainer.php
  17. +2
    -0
      Container/User/UserMerchantContainer.php
  18. +10
    -0
      Repository/AbstractStore.php
  19. +1
    -1
      Repository/Address/AddressStore.php
  20. +1
    -3
      Repository/Config/TaxRateStore.php
  21. +1
    -1
      Repository/Config/UnitStore.php
  22. +1
    -1
      Repository/Credit/CreditHistoryStore.php
  23. +1
    -3
      Repository/Distribution/DistributionStore.php
  24. +1
    -1
      Repository/File/DocumentStore.php
  25. +1
    -2
      Repository/Merchant/MerchantStore.php
  26. +2
    -2
      Repository/MerchantStoreTrait.php
  27. +2
    -0
      Repository/Newsletter/NewsletterStore.php
  28. +1
    -1
      Repository/Order/OrderPaymentStore.php
  29. +1
    -1
      Repository/Order/OrderProductReductionCatalogStore.php
  30. +1
    -1
      Repository/Order/OrderProductRefundStore.php
  31. +1
    -1
      Repository/Order/OrderProductStore.php
  32. +1
    -1
      Repository/Order/OrderReductionCartStore.php
  33. +1
    -1
      Repository/Order/OrderReductionCreditStore.php
  34. +1
    -1
      Repository/Order/OrderRefundStore.php
  35. +1
    -1
      Repository/Order/OrderShopStore.php
  36. +1
    -1
      Repository/Order/OrderStatusHistoryStore.php
  37. +1
    -1
      Repository/Order/OrderStatusStore.php
  38. +1
    -1
      Repository/PointSale/PointSaleStore.php
  39. +1
    -1
      Repository/Product/ProductCategoryStore.php
  40. +1
    -1
      Repository/Product/ProductFamilySectionPropertyStore.php
  41. +1
    -1
      Repository/Product/ProductFamilyStore.php
  42. +1
    -1
      Repository/Product/ProductStore.php
  43. +1
    -1
      Repository/Product/QualityLabelStore.php
  44. +1
    -5
      Repository/Reduction/ReductionCartStore.php
  45. +1
    -1
      Repository/Reduction/ReductionCatalogStore.php
  46. +1
    -5
      Repository/Reduction/ReductionCreditStore.php
  47. +2
    -1
      Repository/Reminder/ReminderStore.php
  48. +1
    -2
      Repository/Section/OpeningStore.php
  49. +1
    -2
      Repository/Section/SectionStore.php
  50. +1
    -1
      Repository/SectionStoreTrait.php
  51. +1
    -1
      Repository/Setting/MerchantSettingStore.php
  52. +1
    -1
      Repository/Setting/SectionSettingStore.php
  53. +3
    -1
      Repository/Site/NewsStore.php
  54. +2
    -2
      Repository/Site/PageStore.php
  55. +17
    -0
      Repository/StoreTrait.php
  56. +2
    -1
      Repository/Ticket/TicketStore.php
  57. +2
    -0
      Repository/User/GroupUserStore.php
  58. +1
    -2
      Repository/User/UserMerchantStore.php
  59. +1
    -1
      Repository/User/UserPointSaleStore.php
  60. +4
    -2
      Repository/User/UserStore.php
  61. +1
    -1
      Repository/User/VisitorStore.php

+ 2
- 0
Container/Address/AddressContainer.php View File

@@ -47,6 +47,8 @@ class AddressContainer

public function getStore(): AddressStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Config/TaxRateContainer.php View File

@@ -34,6 +34,8 @@ class TaxRateContainer

public function getStore(): TaxRateStore
{
$this->store->resetContext();

return $this->store;
}
}

+ 2
- 0
Container/Credit/CreditHistoryContainer.php View File

@@ -51,6 +51,8 @@ class CreditHistoryContainer

public function getStore(): CreditHistoryStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/File/DocumentContainer.php View File

@@ -34,6 +34,8 @@ class DocumentContainer

public function getStore(): DocumentStore
{
$this->store->resetContext();

return $this->store;
}
}

+ 2
- 0
Container/Order/OrderShopContainer.php View File

@@ -59,6 +59,8 @@ class OrderShopContainer

public function getStore(): OrderShopStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/PointSale/PointSaleContainer.php View File

@@ -52,6 +52,8 @@ class PointSaleContainer

public function getStore(): PointSaleStore
{
$this->store->resetContext();

return $this->store;
}
}

+ 2
- 0
Container/Product/ProductCategoryContainer.php View File

@@ -43,6 +43,8 @@ class ProductCategoryContainer

public function getStore(): ProductCategoryStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Product/ProductContainer.php View File

@@ -43,6 +43,8 @@ class ProductContainer

public function getStore(): ProductStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Product/ProductFamilyContainer.php View File

@@ -55,6 +55,8 @@ class ProductFamilyContainer

public function getStore(): ProductFamilyStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Product/ProductFamilySectionPropertyContainer.php View File

@@ -54,6 +54,8 @@ class ProductFamilySectionPropertyContainer

public function getStore(): ProductFamilySectionPropertyStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Reduction/ReductionCartContainer.php View File

@@ -34,6 +34,8 @@ class ReductionCartContainer

public function getStore(): ReductionCartStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Reduction/ReductionCatalogContainer.php View File

@@ -34,6 +34,8 @@ class ReductionCatalogContainer

public function getStore(): ReductionCatalogStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Section/OpeningContainer.php View File

@@ -43,6 +43,8 @@ class OpeningContainer

public function getStore(): OpeningStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Section/SectionContainer.php View File

@@ -52,6 +52,8 @@ class SectionContainer

public function getStore(): SectionStore
{
$this->store->resetContext();

return $this->store;
}
}

+ 2
- 0
Container/Setting/MerchantSettingContainer.php View File

@@ -47,6 +47,8 @@ class MerchantSettingContainer

public function getStore(): MerchantSettingStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/Setting/SectionSettingContainer.php View File

@@ -47,6 +47,8 @@ class SectionSettingContainer

public function getStore(): SectionSettingStore
{
$this->store->resetContext();

return $this->store;
}


+ 2
- 0
Container/User/UserMerchantContainer.php View File

@@ -51,6 +51,8 @@ class UserMerchantContainer

public function getStore(): UserMerchantStore
{
$this->store->resetContext();

return $this->store;
}


+ 10
- 0
Repository/AbstractStore.php View File

@@ -0,0 +1,10 @@
<?php

namespace Lc\CaracoleBundle\Repository;

Use Lc\SovBundle\Repository\AbstractStore as SovAbstractStore;

abstract class AbstractStore extends SovAbstractStore
{
use StoreTrait;
}

+ 1
- 1
Repository/Address/AddressStore.php View File

@@ -2,9 +2,9 @@

namespace Lc\CaracoleBundle\Repository\Address;

use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class AddressStore extends AbstractStore

+ 1
- 3
Repository/Config/TaxRateStore.php View File

@@ -2,10 +2,8 @@

namespace Lc\CaracoleBundle\Repository\Config;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Resolver\MerchantResolver;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class TaxRateStore extends AbstractStore

+ 1
- 1
Repository/Config/UnitStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Config;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class UnitStore extends AbstractStore

+ 1
- 1
Repository/Credit/CreditHistoryStore.php View File

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository\Credit;

use App\Entity\User\UserMerchant;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use DateTime;
use Lc\SovBundle\Repository\RepositoryQueryInterface;


+ 1
- 3
Repository/Distribution/DistributionStore.php View File

@@ -3,9 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Distribution;

use App\Entity\Distribution\Distribution;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class DistributionStore extends AbstractStore

+ 1
- 1
Repository/File/DocumentStore.php View File

@@ -6,7 +6,7 @@ use App\Entity\Address\Address;
use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class DocumentStore extends AbstractStore

+ 1
- 2
Repository/Merchant/MerchantStore.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Merchant;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class MerchantStore extends AbstractStore

+ 2
- 2
Repository/MerchantStoreTrait.php View File

@@ -8,9 +8,9 @@ use Lc\SovBundle\Repository\StoreInterface;

trait MerchantStoreTrait
{
protected MerchantInterface $merchant;
protected ?MerchantInterface $merchant = null;

public function setMerchant(MerchantInterface $merchant):self
public function setMerchant(?MerchantInterface $merchant):self
{
$this->merchant = $merchant;


+ 2
- 0
Repository/Newsletter/NewsletterStore.php View File

@@ -4,11 +4,13 @@ namespace Lc\CaracoleBundle\Repository\Newsletter;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class NewsletterStore extends SovNewsletterStore
{
use StoreTrait;
use SectionStoreTrait;

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface

+ 1
- 1
Repository/Order/OrderPaymentStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderPaymentStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderProductReductionCatalogStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderProductReductionCatalogStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderProductRefundStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderProductRefundStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderProductStore.php View File

@@ -6,7 +6,7 @@ use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusModel;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderProductStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderReductionCartStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderReductionCartStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderReductionCreditStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderReductionCreditStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderRefundStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderRefundStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderShopStore.php View File

@@ -25,7 +25,7 @@ use Lc\CaracoleBundle\Solver\Order\OrderShopSolver;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;

+ 1
- 1
Repository/Order/OrderStatusHistoryStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderStatusHistoryStore extends AbstractStore

+ 1
- 1
Repository/Order/OrderStatusStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Order;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OrderStatusStore extends AbstractStore

+ 1
- 1
Repository/PointSale/PointSaleStore.php View File

@@ -3,7 +3,7 @@
namespace Lc\CaracoleBundle\Repository\PointSale;

use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class PointSaleStore extends AbstractStore

+ 1
- 1
Repository/Product/ProductCategoryStore.php View File

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository\Product;

use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ProductCategoryStore extends AbstractStore

+ 1
- 1
Repository/Product/ProductFamilySectionPropertyStore.php View File

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository\Product;

use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ProductFamilySectionPropertyStore extends AbstractStore

+ 1
- 1
Repository/Product/ProductFamilyStore.php View File

@@ -9,7 +9,7 @@ use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ProductFamilyStore extends AbstractStore

+ 1
- 1
Repository/Product/ProductStore.php View File

@@ -3,7 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Product;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ProductStore extends AbstractStore

+ 1
- 1
Repository/Product/QualityLabelStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Product;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class QualityLabelStore extends AbstractStore

+ 1
- 5
Repository/Reduction/ReductionCartStore.php View File

@@ -2,15 +2,11 @@

namespace Lc\CaracoleBundle\Repository\Reduction;

use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\CaracoleBundle\Repository\Order\OrderShopStore;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;

class ReductionCartStore extends AbstractStore
{

+ 1
- 1
Repository/Reduction/ReductionCatalogStore.php View File

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository\Reduction;

use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCatalogStore extends AbstractStore

+ 1
- 5
Repository/Reduction/ReductionCreditStore.php View File

@@ -2,14 +2,10 @@

namespace Lc\CaracoleBundle\Repository\Reduction;

use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\Order\OrderShopStore;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCreditStore extends AbstractStore

+ 2
- 1
Repository/Reminder/ReminderStore.php View File

@@ -4,12 +4,13 @@ namespace Lc\CaracoleBundle\Repository\Reminder;

use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\Reminder\ReminderStore as SovReminderStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReminderStore extends SovReminderStore
{
use StoreTrait;
use SectionStoreTrait;
use MerchantStoreTrait;


+ 1
- 2
Repository/Section/OpeningStore.php View File

@@ -3,8 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Section;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Solver\Section\OpeningSolver;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class OpeningStore extends AbstractStore

+ 1
- 2
Repository/Section/SectionStore.php View File

@@ -2,11 +2,10 @@

namespace Lc\CaracoleBundle\Repository\Section;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\Order\OrderShopStore;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;


+ 1
- 1
Repository/SectionStoreTrait.php View File

@@ -10,7 +10,7 @@ trait SectionStoreTrait
{
protected ?SectionInterface $section = null;

public function setSection(SectionInterface $section):self
public function setSection(?SectionInterface $section):self
{
$this->section = $section;


+ 1
- 1
Repository/Setting/MerchantSettingStore.php View File

@@ -3,7 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Setting;

use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class MerchantSettingStore extends AbstractStore

+ 1
- 1
Repository/Setting/SectionSettingStore.php View File

@@ -3,7 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Setting;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class SectionSettingStore extends AbstractStore

+ 3
- 1
Repository/Site/NewsStore.php View File

@@ -3,16 +3,18 @@
namespace Lc\CaracoleBundle\Repository\Site;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\Site\NewsStore as SovNewsStore;

class NewsStore extends SovNewsStore
{
use StoreTrait;
use SectionStoreTrait;

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->filterBySection($this->section);
$this->addFilterBySectionOptionnal($query);
return parent::filtersDefault($query);
}


+ 2
- 2
Repository/Site/PageStore.php View File

@@ -2,15 +2,15 @@

namespace Lc\CaracoleBundle\Repository\Site;

use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\Site\PageInterface;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\Site\PageStore as SovPageStore;

class PageStore extends SovPageStore
{
use StoreTrait;
use MerchantStoreTrait;
use SectionStoreTrait;


+ 17
- 0
Repository/StoreTrait.php View File

@@ -0,0 +1,17 @@
<?php

namespace Lc\CaracoleBundle\Repository;

trait StoreTrait
{
public function resetContext(): void
{
if(method_exists($this, 'setMerchant')) {
$this->setMerchant(null);
}

if(method_exists($this, 'setSection')) {
$this->setSection(null);
}
}
}

+ 2
- 1
Repository/Ticket/TicketStore.php View File

@@ -3,12 +3,13 @@
namespace Lc\CaracoleBundle\Repository\Ticket;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\Ticket\TicketStore as SovTicketStore;

class TicketStore extends SovTicketStore
{
use StoreTrait;
use SectionStoreTrait;

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface

+ 2
- 0
Repository/User/GroupUserStore.php View File

@@ -3,11 +3,13 @@
namespace Lc\CaracoleBundle\Repository\User;

use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\User\GroupUserStore as SovGroupUserStore;

class GroupUserStore extends SovGroupUserStore
{
use StoreTrait;
use MerchantStoreTrait;

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface

+ 1
- 2
Repository/User/UserMerchantStore.php View File

@@ -2,12 +2,11 @@

namespace Lc\CaracoleBundle\Repository\User;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Solver\User\UserMerchantSolver;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class UserMerchantStore extends AbstractStore

+ 1
- 1
Repository/User/UserPointSaleStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\User;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class UserPointSaleStore extends AbstractStore

+ 4
- 2
Repository/User/UserStore.php View File

@@ -2,18 +2,20 @@

namespace Lc\CaracoleBundle\Repository\User;

use App\Entity\Newsletter\Newsletter;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\User\UserStore as SovUserStore;

class UserStore extends SovUserStore
{
use StoreTrait;
use MerchantStoreTrait;

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->filterByMerchant($this->merchant);
$this->addFilterByMerchantOptionnal($this->merchant);

return $query;
}


+ 1
- 1
Repository/User/VisitorStore.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Repository\User;

use Lc\SovBundle\Repository\AbstractStore;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class VisitorStore extends AbstractStore

Loading…
Cancel
Save