$orderShop->setDeclineComplementaryOrderShop(false); | $orderShop->setDeclineComplementaryOrderShop(false); | ||||
} | } | ||||
public function getProductsSalesStatistic(SectionInterface $section, $entity, $nbWeek = 2) | public function getProductsSalesStatistic(SectionInterface $section, $entity, $nbWeek = 2) | ||||
{ | { | ||||
$productsSalesStatistic = new ProductsSalesStatistic( | $productsSalesStatistic = new ProductsSalesStatistic( |
public function getStore(): AddressStore | public function getStore(): AddressStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): TaxRateStore | public function getStore(): TaxRateStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
} | } |
public function getStore(): CreditHistoryStore | public function getStore(): CreditHistoryStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): DocumentStore | public function getStore(): DocumentStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
} | } |
public function getStore(): OrderShopStore | public function getStore(): OrderShopStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): PointSaleStore | public function getStore(): PointSaleStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
} | } |
namespace Lc\CaracoleBundle\Container\Product; | namespace Lc\CaracoleBundle\Container\Product; | ||||
use Lc\CaracoleBundle\Definition\Field\Product\ProductCategoryFieldDefinition; | |||||
use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory; | use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory; | ||||
use Lc\CaracoleBundle\Repository\Product\ProductCategoryRepositoryQuery; | use Lc\CaracoleBundle\Repository\Product\ProductCategoryRepositoryQuery; | ||||
use Lc\CaracoleBundle\Repository\Product\ProductCategoryStore; | use Lc\CaracoleBundle\Repository\Product\ProductCategoryStore; | ||||
protected ProductCategorySolver $solver; | protected ProductCategorySolver $solver; | ||||
protected ProductCategoryRepositoryQuery $repositoryQuery; | protected ProductCategoryRepositoryQuery $repositoryQuery; | ||||
protected ProductCategoryStore $store; | protected ProductCategoryStore $store; | ||||
protected ProductCategoryFieldDefinition $fieldDefinition; | |||||
public function __construct( | public function __construct( | ||||
ProductCategoryFactory $factory, | ProductCategoryFactory $factory, | ||||
ProductCategorySolver $solver, | ProductCategorySolver $solver, | ||||
ProductCategoryRepositoryQuery $repositoryQuery, | ProductCategoryRepositoryQuery $repositoryQuery, | ||||
ProductCategoryStore $store | |||||
ProductCategoryStore $store, | |||||
ProductCategoryFieldDefinition $fieldDefinition | |||||
) { | ) { | ||||
$this->factory = $factory; | $this->factory = $factory; | ||||
$this->solver = $solver; | $this->solver = $solver; | ||||
$this->repositoryQuery = $repositoryQuery; | $this->repositoryQuery = $repositoryQuery; | ||||
$this->store = $store; | $this->store = $store; | ||||
$this->fieldDefinition = $fieldDefinition; | |||||
} | } | ||||
public function getFactory(): ProductCategoryFactory | public function getFactory(): ProductCategoryFactory | ||||
public function getStore(): ProductCategoryStore | public function getStore(): ProductCategoryStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getFieldDefinition(): ProductCategoryFieldDefinition | |||||
{ | |||||
return $this->fieldDefinition; | |||||
} | |||||
} | } |
public function getStore(): ProductStore | public function getStore(): ProductStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): ProductFamilyStore | public function getStore(): ProductFamilyStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): ProductFamilySectionPropertyStore | public function getStore(): ProductFamilySectionPropertyStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Container\Reduction; | namespace Lc\CaracoleBundle\Container\Reduction; | ||||
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCartFieldDefinition; | |||||
use Lc\CaracoleBundle\Factory\Reduction\ReductionCartFactory; | use Lc\CaracoleBundle\Factory\Reduction\ReductionCartFactory; | ||||
use Lc\CaracoleBundle\Repository\Reduction\ReductionCartRepositoryQuery; | use Lc\CaracoleBundle\Repository\Reduction\ReductionCartRepositoryQuery; | ||||
use Lc\CaracoleBundle\Repository\Reduction\ReductionCartStore; | use Lc\CaracoleBundle\Repository\Reduction\ReductionCartStore; | ||||
protected ReductionCartFactory $factory; | protected ReductionCartFactory $factory; | ||||
protected ReductionCartRepositoryQuery $repositoryQuery; | protected ReductionCartRepositoryQuery $repositoryQuery; | ||||
protected ReductionCartStore $store; | protected ReductionCartStore $store; | ||||
protected ReductionCartFieldDefinition $fieldDefinition; | |||||
public function __construct( | public function __construct( | ||||
ReductionCartFactory $factory, | ReductionCartFactory $factory, | ||||
ReductionCartRepositoryQuery $repositoryQuery, | ReductionCartRepositoryQuery $repositoryQuery, | ||||
ReductionCartStore $store | |||||
ReductionCartStore $store, | |||||
ReductionCartFieldDefinition $fieldDefinition | |||||
) { | ) { | ||||
$this->factory = $factory; | $this->factory = $factory; | ||||
$this->repositoryQuery = $repositoryQuery; | $this->repositoryQuery = $repositoryQuery; | ||||
$this->store = $store; | $this->store = $store; | ||||
$this->fieldDefinition = $fieldDefinition; | |||||
} | } | ||||
public function getFactory(): ReductionCartFactory | public function getFactory(): ReductionCartFactory | ||||
public function getStore(): ReductionCartStore | public function getStore(): ReductionCartStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getFieldDefinition(): ReductionCartFieldDefinition | |||||
{ | |||||
return $this->fieldDefinition; | |||||
} | |||||
} | } |
namespace Lc\CaracoleBundle\Container\Reduction; | namespace Lc\CaracoleBundle\Container\Reduction; | ||||
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCatalogFieldDefinition; | |||||
use Lc\CaracoleBundle\Factory\Reduction\ReductionCatalogFactory; | use Lc\CaracoleBundle\Factory\Reduction\ReductionCatalogFactory; | ||||
use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogRepositoryQuery; | use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogRepositoryQuery; | ||||
use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogStore; | use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogStore; | ||||
protected ReductionCatalogFactory $factory; | protected ReductionCatalogFactory $factory; | ||||
protected ReductionCatalogRepositoryQuery $repositoryQuery; | protected ReductionCatalogRepositoryQuery $repositoryQuery; | ||||
protected ReductionCatalogStore $store; | protected ReductionCatalogStore $store; | ||||
protected ReductionCatalogFieldDefinition $fieldDefinition; | |||||
public function __construct( | public function __construct( | ||||
ReductionCatalogFactory $factory, | ReductionCatalogFactory $factory, | ||||
ReductionCatalogRepositoryQuery $repositoryQuery, | ReductionCatalogRepositoryQuery $repositoryQuery, | ||||
ReductionCatalogStore $store | |||||
ReductionCatalogStore $store, | |||||
ReductionCatalogFieldDefinition $fieldDefinition | |||||
) { | ) { | ||||
$this->factory = $factory; | $this->factory = $factory; | ||||
$this->repositoryQuery = $repositoryQuery; | $this->repositoryQuery = $repositoryQuery; | ||||
$this->store = $store; | $this->store = $store; | ||||
$this->fieldDefinition = $fieldDefinition; | |||||
} | } | ||||
public function getFactory(): ReductionCatalogFactory | public function getFactory(): ReductionCatalogFactory | ||||
public function getStore(): ReductionCatalogStore | public function getStore(): ReductionCatalogStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getFieldDefinition(): ReductionCatalogFieldDefinition | |||||
{ | |||||
return $this->fieldDefinition; | |||||
} | |||||
} | } |
public function getStore(): OpeningStore | public function getStore(): OpeningStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): SectionStore | public function getStore(): SectionStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
} | } |
public function getStore(): MerchantSettingStore | public function getStore(): MerchantSettingStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): SectionSettingStore | public function getStore(): SectionSettingStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
public function getStore(): UserMerchantStore | public function getStore(): UserMerchantStore | ||||
{ | { | ||||
$this->store->resetContext(); | |||||
return $this->store; | return $this->store; | ||||
} | } | ||||
trait SectionContextTrait | trait SectionContextTrait | ||||
{ | { | ||||
protected SectionInterface $section; | |||||
protected ?SectionInterface $section; | |||||
public function setSection(SectionInterface $section) | |||||
public function setSection(?SectionInterface $section) | |||||
{ | { | ||||
$this->section = $section; | $this->section = $section; | ||||
namespace Lc\CaracoleBundle\Controller; | namespace Lc\CaracoleBundle\Controller; | ||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Doctrine\ORM\QueryBuilder; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | use EasyCorp\Bundle\EasyAdminBundle\Config\Action; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Exception\InsufficientEntityPermissionException; | use EasyCorp\Bundle\EasyAdminBundle\Exception\InsufficientEntityPermissionException; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission; | use EasyCorp\Bundle\EasyAdminBundle\Security\Permission; | ||||
use Lc\CaracoleBundle\Container\Address\AddressContainer; | |||||
use Lc\CaracoleBundle\Container\Config\TaxRateContainer; | |||||
use Lc\CaracoleBundle\Container\Config\UnitContainer; | |||||
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer; | |||||
use Lc\CaracoleBundle\Container\File\DocumentContainer; | |||||
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderProductContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderProductReductionCatalogContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderProductRefundContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderReductionCartContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderReductionCreditContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderRefundContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderShopContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderStatusContainer; | |||||
use Lc\CaracoleBundle\Container\Order\OrderStatusHistoryContainer; | |||||
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer; | |||||
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer; | |||||
use Lc\CaracoleBundle\Container\Product\ProductContainer; | |||||
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer; | |||||
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer; | |||||
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer; | |||||
use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer; | |||||
use Lc\CaracoleBundle\Container\Section\OpeningContainer; | |||||
use Lc\CaracoleBundle\Container\Section\SectionContainer; | |||||
use Lc\CaracoleBundle\Container\Setting\MerchantSettingContainer; | |||||
use Lc\CaracoleBundle\Container\Setting\SectionSettingContainer; | |||||
use Lc\CaracoleBundle\Container\User\UserMerchantContainer; | |||||
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer; | |||||
use Lc\CaracoleBundle\Container\User\VisitorContainer; | |||||
use Lc\CaracoleBundle\Definition\ActionDefinition; | use Lc\CaracoleBundle\Definition\ActionDefinition; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface; | ||||
trait AdminControllerTrait | trait AdminControllerTrait | ||||
{ | { | ||||
use ControllerTrait; | use ControllerTrait; | ||||
//TODO doit implementer ControllerTrait | |||||
/*public static function getSubscribedServices() | |||||
{ | |||||
return array_merge( | |||||
parent::getSubscribedServices(), | |||||
self::getSubscribedServicesList() | |||||
); | |||||
} | |||||
public static function getSubscribedServicesList() | |||||
{ | |||||
return [ | |||||
MerchantResolver::class => MerchantResolver::class, | |||||
SectionResolver::class => SectionResolver::class, | |||||
AddressContainer::class => AddressContainer::class, | |||||
TaxRateContainer::class => TaxRateContainer::class, | |||||
UnitContainer::class => UnitContainer::class, | |||||
CreditHistoryContainer::class => CreditHistoryContainer::class, | |||||
DocumentContainer::class => DocumentContainer::class, | |||||
MerchantContainer::class => MerchantContainer::class, | |||||
OrderPaymentContainer::class => OrderPaymentContainer::class, | |||||
OrderProductContainer::class => OrderProductContainer::class, | |||||
OrderProductReductionCatalogContainer::class => OrderProductReductionCatalogContainer::class, | |||||
OrderProductRefundContainer::class => OrderProductRefundContainer::class, | |||||
OrderReductionCartContainer::class => OrderReductionCartContainer::class, | |||||
OrderReductionCreditContainer::class => OrderReductionCreditContainer::class, | |||||
OrderRefundContainer::class => OrderRefundContainer::class, | |||||
OrderShopContainer::class => OrderShopContainer::class, | |||||
OrderStatusContainer::class => OrderStatusContainer::class, | |||||
OrderStatusHistoryContainer::class => OrderStatusHistoryContainer::class, | |||||
PointSaleContainer::class => PointSaleContainer::class, | |||||
ProductCategoryContainer::class => ProductCategoryContainer::class, | |||||
ProductContainer::class => ProductContainer::class, | |||||
ProductFamilyContainer::class => ProductFamilyContainer::class, | |||||
ReductionCartContainer::class => ReductionCartContainer::class, | |||||
ReductionCatalogContainer::class => ReductionCatalogContainer::class, | |||||
ReductionCreditContainer::class => ReductionCreditContainer::class, | |||||
OpeningContainer::class => OpeningContainer::class, | |||||
SectionContainer::class => SectionContainer::class, | |||||
MerchantSettingContainer::class => MerchantSettingContainer::class, | |||||
SectionSettingContainer::class => SectionSettingContainer::class, | |||||
UserMerchantContainer::class => UserMerchantContainer::class, | |||||
UserPointSaleContainer::class => UserPointSaleContainer::class, | |||||
VisitorContainer::class => VisitorContainer::class | |||||
]; | |||||
}*/ | |||||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | ||||
{ | { | ||||
$responseParameters = parent::configureResponseParameters($responseParameters); | $responseParameters = parent::configureResponseParameters($responseParameters); | ||||
// affichage du filtre sur section | |||||
$this->configureResponseParametersFilterSection($responseParameters); | |||||
return $responseParameters; | |||||
} | |||||
public function configureResponseParametersFilterSection(KeyValueStore $responseParameters) | |||||
{ | |||||
if ($this->isInstanceOf(FilterSectionInterface::class)) { | if ($this->isInstanceOf(FilterSectionInterface::class)) { | ||||
$responseParameters->set('display_switch_section', true); | $responseParameters->set('display_switch_section', true); | ||||
} | } | ||||
} | |||||
return $responseParameters; | |||||
public function configureResponseParametersDisableShowAllSections(KeyValueStore $responseParameters) | |||||
{ | |||||
$responseParameters->set('replace_content_with_message', "Vous devez sélectionner une section pour afficher ces données."); | |||||
} | } | ||||
public function createIndexRepositoryQuery( | public function createIndexRepositoryQuery( | ||||
$filters | $filters | ||||
); | ); | ||||
if ($this->isInstanceOf(FilterMerchantInterface::class) || $this->isInstanceOf(FilterMultipleMerchantsInterface::class)) { | |||||
$sectionCurrent = $this->get(SectionResolver::class)->getCurrent(); | |||||
if ($this->isInstanceOf(FilterMerchantInterface::class) | |||||
|| $this->isInstanceOf(FilterMultipleMerchantsInterface::class)) { | |||||
$repositoryQuery->filterByMerchant($this->get(MerchantResolver::class)->getCurrent()); | $repositoryQuery->filterByMerchant($this->get(MerchantResolver::class)->getCurrent()); | ||||
} | } | ||||
if ($this->isInstanceOf(FilterSectionInterface::class)) { | |||||
$repositoryQuery->filterBySection($this->get(SectionResolver::class)->getCurrent()); | |||||
if ($sectionCurrent && $this->isInstanceOf(FilterSectionInterface::class)) { | |||||
$repositoryQuery->filterBySection($sectionCurrent); | |||||
} | } | ||||
return $repositoryQuery; | return $repositoryQuery; |
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | ||||
use Lc\CaracoleBundle\Model\User\VisitorInterface; | use Lc\CaracoleBundle\Model\User\VisitorInterface; | ||||
use Lc\CaracoleBundle\Notification\MailMailjetNotification; | |||||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | use Lc\CaracoleBundle\Resolver\MerchantResolver; | ||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | use Lc\CaracoleBundle\Resolver\SectionResolver; | ||||
use Lc\CaracoleBundle\Solver\Price\PriceSolver; | use Lc\CaracoleBundle\Solver\Price\PriceSolver; | ||||
return array_merge( | return array_merge( | ||||
parent::getSubscribedServices(), | parent::getSubscribedServices(), | ||||
[ | [ | ||||
MailMailjetNotification::class => MailMailjetNotification::class, | |||||
PriceSolver::class => PriceSolver::class, | PriceSolver::class => PriceSolver::class, | ||||
MerchantResolver::class => MerchantResolver::class, | MerchantResolver::class => MerchantResolver::class, | ||||
SectionResolver::class => SectionResolver::class, | SectionResolver::class => SectionResolver::class, | ||||
); | ); | ||||
} | } | ||||
public function getMailMailjetNotification() | |||||
{ | |||||
return $this->get(MailMailjetNotification::class); | |||||
} | |||||
public function getMerchantSettingCurrent(string $settingName) | public function getMerchantSettingCurrent(string $settingName) | ||||
{ | { | ||||
return $this->getSettingValue($this->getMerchantCurrent(), $settingName); | return $this->getSettingValue($this->getMerchantCurrent(), $settingName); | ||||
return $this->get(MerchantResolver::class)->getMerchantUser($this->getUserCurrent()); | return $this->get(MerchantResolver::class)->getMerchantUser($this->getUserCurrent()); | ||||
} | } | ||||
public function getSectionCurrent(): SectionInterface | |||||
public function getSectionCurrent(): ?SectionInterface | |||||
{ | { | ||||
return $this->get(SectionResolver::class)->getCurrent(); | return $this->get(SectionResolver::class)->getCurrent(); | ||||
} | } |
namespace Lc\CaracoleBundle\Controller\Newsletter; | namespace Lc\CaracoleBundle\Controller\Newsletter; | ||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | use Lc\CaracoleBundle\Controller\AdminControllerTrait; | ||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||||
use Lc\SovBundle\Container\Newsletter\NewsletterContainer; | use Lc\SovBundle\Container\Newsletter\NewsletterContainer; | ||||
use Lc\SovBundle\Controller\Newsletter\NewsletterAdminController as SovNewsletterAdminController; | use Lc\SovBundle\Controller\Newsletter\NewsletterAdminController as SovNewsletterAdminController; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
abstract class NewsletterAdminController extends SovNewsletterAdminController | abstract class NewsletterAdminController extends SovNewsletterAdminController | ||||
{ | { | ||||
{ | { | ||||
return $this->get(NewsletterContainer::class) | return $this->get(NewsletterContainer::class) | ||||
->getFactory() | ->getFactory() | ||||
->setSection($this->get(SectionResolver::class)->getCurrent()) | |||||
->setSection($this->getSectionCurrent()) | |||||
->create(); | ->create(); | ||||
} | } | ||||
public function configureFields(string $pageName): iterable | |||||
{ | |||||
return $this->getNewsletterContainer()->getFieldDefinition() | |||||
->setMerchant($this->getMerchantCurrent()) | |||||
->setSection($this->getSectionCurrent()) | |||||
->getFields($pageName); | |||||
} | |||||
} | } |
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
return array_merge( | |||||
[ | |||||
FormField::addPanel('general'), | |||||
IntegerField::new('id')->onlyOnIndex()->setSortable(true), | |||||
TextField::new('title')->setSortable(true), | |||||
NumberField::new('position')->hideOnForm()->setSortable(true), | |||||
AssociationField::new('parent')->hideOnIndex(), | |||||
DateTimeField::new('createdAt')->setFormat('short')->setSortable(true), | |||||
CKEditorField::new('description')->hideOnIndex(), | |||||
StatusField::new('status')->setSortable(true), | |||||
ToggleField::new('saleStatus')->setSortable(true), | |||||
ToggleField::new('isEligibleTicketRestaurant')->setSortable(true), | |||||
], | |||||
$this->getSeoPanel(), | |||||
$this->getConfPanel() | |||||
); | |||||
return $this->getProductCategoryContainer()->getFieldDefinition() | |||||
->setMerchant($this->getMerchantCurrent()) | |||||
->setSection($this->getSectionCurrent()) | |||||
->getFields($pageName); | |||||
} | } | ||||
} | } |
namespace Lc\CaracoleBundle\Controller\Section; | namespace Lc\CaracoleBundle\Controller\Section; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TimeField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TimeField; | ||||
{ | { | ||||
use AdminControllerTrait; | use AdminControllerTrait; | ||||
public function createEntity(string $entityFqcn) | |||||
{ | |||||
return $this->getOpeningContainer() | |||||
->getFactory() | |||||
->create($this->getSectionCurrent()); | |||||
} | |||||
public function getRepositoryQuery() :RepositoryQueryInterface | public function getRepositoryQuery() :RepositoryQueryInterface | ||||
{ | { | ||||
return $this->get(OpeningContainer::class)->getRepositoryQuery(); | return $this->get(OpeningContainer::class)->getRepositoryQuery(); | ||||
} | } | ||||
public function configureCrud(Crud $crud): Crud | |||||
{ | |||||
$crud = parent::configureCrud($crud); | |||||
$crud->setDefaultSort(['day' => 'ASC']); | |||||
return $crud; | |||||
} | |||||
public function configureFields(string $pageName): iterable | public function configureFields(string $pageName): iterable | ||||
{ | { | ||||
return [ | return [ | ||||
]; | ]; | ||||
} | } | ||||
public function configureCrud(Crud $crud): Crud | |||||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | |||||
{ | { | ||||
$crud = parent::configureCrud($crud); | |||||
$responseParameters = parent::configureResponseParameters($responseParameters); | |||||
$crud->setDefaultSort(['day' => 'ASC']); | |||||
$this->configureResponseParametersFilterSection($responseParameters); | |||||
$this->configureResponseParametersDisableShowAllSections($responseParameters); | |||||
return $crud; | |||||
} | |||||
public function createEntity(string $entityFqcn) | |||||
{ | |||||
return $this->getOpeningContainer() | |||||
->getFactory() | |||||
->create($this->getSectionCurrent()); | |||||
return $responseParameters; | |||||
} | } | ||||
} | } |
abstract class SectionAdminController extends AbstractAdminController | abstract class SectionAdminController extends AbstractAdminController | ||||
{ | { | ||||
public function getRepositoryQuery() :RepositoryQueryInterface | public function getRepositoryQuery() :RepositoryQueryInterface | ||||
{ | { | ||||
return $this->get(SectionContainer::class)->getRepositoryQuery(); | return $this->get(SectionContainer::class)->getRepositoryQuery(); |
$form->handleRequest($request); | $form->handleRequest($request); | ||||
if ($form->isSubmitted() && $form->isValid()) { | if ($form->isSubmitted() && $form->isValid()) { | ||||
// valeur par défaut de $section : Tout afficher | |||||
$section = null; | |||||
$idSection = $form->get('id_section')->getData(); | $idSection = $form->get('id_section')->getData(); | ||||
$section = $sectionContainer->getStore()->getOneById($idSection); | |||||
$userMerchant = $merchantResolver->getUserMerchant(); | $userMerchant = $merchantResolver->getUserMerchant(); | ||||
if ($section && $userMerchant) { | |||||
if($userMerchant) { | |||||
if($idSection) { | |||||
$section = $sectionContainer->getStore()->getOneById($idSection); | |||||
} | |||||
$userMerchant->setCurrentAdminSection($section); | $userMerchant->setCurrentAdminSection($section); | ||||
$entityManager->update($section); | |||||
$entityManager->update($userMerchant); | |||||
$entityManager->flush(); | $entityManager->flush(); | ||||
} | } | ||||
} | } |
namespace Lc\CaracoleBundle\Controller\Setting; | namespace Lc\CaracoleBundle\Controller\Setting; | ||||
use Lc\CaracoleBundle\Container\Setting\MerchantSettingContainer; | |||||
use Lc\CaracoleBundle\Container\Setting\SectionSettingContainer; | |||||
use Lc\CaracoleBundle\Controller\ControllerTrait; | use Lc\CaracoleBundle\Controller\ControllerTrait; | ||||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||||
use Lc\SovBundle\Container\Setting\SiteSettingContainer; | |||||
use Lc\SovBundle\Container\Site\SiteContainer; | |||||
use Lc\SovBundle\Controller\Setting\SettingAdminController as SovSettingController; | use Lc\SovBundle\Controller\Setting\SettingAdminController as SovSettingController; | ||||
use Doctrine\ORM\EntityManagerInterface; | |||||
use Lc\CaracoleBundle\Form\Setting\MerchantSettingsFormType; | use Lc\CaracoleBundle\Form\Setting\MerchantSettingsFormType; | ||||
use Lc\CaracoleBundle\Form\Setting\SectionSettingsFormType; | use Lc\CaracoleBundle\Form\Setting\SectionSettingsFormType; | ||||
use Lc\SovBundle\Form\Setting\SiteSettingsFormType; | use Lc\SovBundle\Form\Setting\SiteSettingsFormType; | ||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\HttpFoundation\Request; | use Symfony\Component\HttpFoundation\Request; | ||||
use Symfony\Component\Routing\Annotation\Route; | use Symfony\Component\Routing\Annotation\Route; | ||||
/** | /** | ||||
* @Route("/admin/setting/merchant", name="carac_admin_setting_merchant") | * @Route("/admin/setting/merchant", name="carac_admin_setting_merchant") | ||||
*/ | */ | ||||
public function manageMerchant( | |||||
Request $request | |||||
) { | |||||
public function manageMerchant(Request $request) | |||||
{ | |||||
return $this->manage($request, 'merchant'); | return $this->manage($request, 'merchant'); | ||||
} | } | ||||
/** | /** | ||||
* @Route("/admin/setting/section", name="carac_admin_setting_section") | * @Route("/admin/setting/section", name="carac_admin_setting_section") | ||||
*/ | */ | ||||
public function manageSection( | |||||
Request $request | |||||
) { | |||||
public function manageSection(Request $request) | |||||
{ | |||||
return $this->manage($request, 'section'); | return $this->manage($request, 'section'); | ||||
} | } | ||||
} | } | ||||
$entity = $resolver->getCurrent(); | $entity = $resolver->getCurrent(); | ||||
$displaySwitchSection = ($type == 'section') ? true : false; | |||||
$view = '@LcCaracole/admin/setting/edit_' . $type . '.html.twig'; | |||||
if ($entity) { | if ($entity) { | ||||
$form = $this->createForm($formClass, $entity); | $form = $this->createForm($formClass, $entity); | ||||
$entityManager->update($entity); | $entityManager->update($entity); | ||||
$entityManager->flush(); | $entityManager->flush(); | ||||
$this->addFlashTranslator('success','updated'); | |||||
$this->addFlashTranslator('success', 'updated'); | |||||
} | } | ||||
return $this->render( | return $this->render( | ||||
'@LcCaracole/admin/setting/edit_' . $type . '.html.twig', | |||||
$view, | |||||
[ | [ | ||||
'display_switch_section' => ($type == 'section') ? true : false, | |||||
'display_switch_section' => $displaySwitchSection, | |||||
'resolver' => $resolver, | 'resolver' => $resolver, | ||||
'setting_definition' => $settingDefinition, | 'setting_definition' => $settingDefinition, | ||||
'form' => $form->createView() | 'form' => $form->createView() | ||||
] | ] | ||||
); | ); | ||||
} | } | ||||
else { | |||||
return $this->render( | |||||
$view, | |||||
[ | |||||
'display_switch_section' => $displaySwitchSection, | |||||
'replace_content_with_message' => "Vous devez sélectionner une section pour afficher ces données." | |||||
] | |||||
); | |||||
} | |||||
} | } | ||||
/** | /** | ||||
$entityManager->update($site); | $entityManager->update($site); | ||||
$entityManager->flush(); | $entityManager->flush(); | ||||
$this->addFlashTranslator('success','updated'); | |||||
$this->addFlashTranslator('success', 'updated'); | |||||
} | } | ||||
return $this->render( | return $this->render( |
namespace Lc\CaracoleBundle\Controller\Site; | namespace Lc\CaracoleBundle\Controller\Site; | ||||
use Lc\CaracoleBundle\Controller\ControllerTrait; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||||
use Lc\SovBundle\Controller\Site\NewsAdminController as SovNewsAdminController; | use Lc\SovBundle\Controller\Site\NewsAdminController as SovNewsAdminController; | ||||
abstract class NewsAdminController extends SovNewsAdminController | abstract class NewsAdminController extends SovNewsAdminController | ||||
{ | { | ||||
use ControllerTrait; | |||||
use AdminControllerTrait; | |||||
public function createEntity(string $entityFqcn) | public function createEntity(string $entityFqcn) | ||||
{ | { |
namespace Lc\CaracoleBundle\Controller\Site; | namespace Lc\CaracoleBundle\Controller\Site; | ||||
use Lc\CaracoleBundle\Controller\ControllerTrait; | |||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||||
use Lc\SovBundle\Controller\Site\PageAdminController as SovPageAdminController; | use Lc\SovBundle\Controller\Site\PageAdminController as SovPageAdminController; | ||||
abstract class PageAdminController extends SovPageAdminController | abstract class PageAdminController extends SovPageAdminController | ||||
{ | { | ||||
use ControllerTrait; | |||||
use AdminControllerTrait; | |||||
public function createEntity(string $entityFqcn) | public function createEntity(string $entityFqcn) | ||||
{ | { | ||||
return $this->getPageContainer() | return $this->getPageContainer() | ||||
->getFactory() | ->getFactory() | ||||
->setMerchant($this->getMerchantCurrent()) | |||||
->setSection($this->getSectionCurrent()) | ->setSection($this->getSectionCurrent()) | ||||
->create(); | ->create(); | ||||
} | } |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field; | |||||
use Lc\SovBundle\Definition\Field\AbstractFieldDefinition as SovAbstractFieldDefinition; | |||||
abstract class AbstractFieldDefinition extends SovAbstractFieldDefinition | |||||
{ | |||||
use FieldDefinitionTrait; | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field; | |||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | |||||
use Lc\CaracoleBundle\Context\SectionContextTrait; | |||||
use Lc\CaracoleBundle\Field\AssociationField; | |||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
trait FieldDefinitionTrait | |||||
{ | |||||
use MerchantContextTrait; | |||||
use SectionContextTrait; | |||||
public function configureFieldsBase(): array | |||||
{ | |||||
$sectionArray = $this->sectionStore->setMerchant($this->merchant)->get(); | |||||
return array_merge(parent::configureFieldsBase(), [ | |||||
'section' => AssociationField::new('section') | |||||
->setTemplatePath('@LcCaracole/admin/section/field/section.html.twig') | |||||
->setFormTypeOption('choices', $sectionArray) | |||||
]); | |||||
} | |||||
public function addSectionToFieldArrayIfOutOfSection(?SectionInterface $sectionCurrent, array $fieldArray) | |||||
{ | |||||
$asObject = true; | |||||
if(is_string($fieldArray[array_key_first($fieldArray)])) { | |||||
$asObject = false; | |||||
} | |||||
$fieldSectionArray = []; | |||||
if($sectionCurrent == null) { | |||||
if($asObject) { | |||||
$allFieldArray = $this->getAllFields(); | |||||
$fieldSectionArray = [$allFieldArray['section']]; | |||||
} | |||||
else { | |||||
$fieldSectionArray = ['section']; | |||||
} | |||||
} | |||||
return array_merge($fieldSectionArray, $fieldArray); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Newsletter; | |||||
use Lc\CaracoleBundle\Definition\Field\FieldDefinitionTrait; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Definition\Field\Newsletter\NewsletterFieldDefinition as SovNewsletterFieldDefinition; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class NewsletterFieldDefinition extends SovNewsletterFieldDefinition | |||||
{ | |||||
use FieldDefinitionTrait; | |||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureIndex(): array | |||||
{ | |||||
return $this->addSectionToFieldArrayIfOutOfSection($this->section, [ | |||||
'id', | |||||
'title', | |||||
'isMain', | |||||
'status' | |||||
]); | |||||
} | |||||
public function configurePanelMain(): array | |||||
{ | |||||
return array_merge(['section'], parent::configurePanelMain()); | |||||
} | |||||
} |
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | use Lc\CaracoleBundle\Context\MerchantContextTrait; | ||||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | |||||
use Lc\CaracoleBundle\Field\AssociationField; | use Lc\CaracoleBundle\Field\AssociationField; | ||||
use Lc\SovBundle\Definition\Field\AbstractFieldDefinition; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\Form\Extension\Core\Type\TextType; | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||||
class OrderShopFieldDefinition extends AbstractFieldDefinition | class OrderShopFieldDefinition extends AbstractFieldDefinition | ||||
{ | { | ||||
use MerchantContextTrait; | use MerchantContextTrait; | ||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureFieldsIndex(): array | public function configureFieldsIndex(): array | ||||
{ | { | ||||
return ['id']; | return ['id']; |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Product; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | |||||
use Lc\CaracoleBundle\Repository\Product\ProductCategoryStore; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Field\CKEditorField; | |||||
use Lc\SovBundle\Field\ToggleField; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class ProductCategoryFieldDefinition extends AbstractFieldDefinition | |||||
{ | |||||
protected SectionStore $sectionStore; | |||||
protected ProductCategoryStore $productCategoryStore; | |||||
public function __construct( | |||||
TranslatorAdmin $translatorAdmin, | |||||
SectionStore $sectionStore, | |||||
ProductCategoryStore $productCategoryStore | |||||
) { | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
$this->productCategoryStore = $productCategoryStore; | |||||
} | |||||
public function configureIndex(): array | |||||
{ | |||||
$fieldArray = ($this->section == null) ? ['section'] : []; | |||||
return array_merge($fieldArray, [ | |||||
'id', | |||||
'title', | |||||
'status' | |||||
]); | |||||
} | |||||
public function configurePanels(): array | |||||
{ | |||||
return [ | |||||
'main', | |||||
'seo', | |||||
'conf' | |||||
]; | |||||
} | |||||
public function configurePanelMain() | |||||
{ | |||||
return [ | |||||
'section', | |||||
'title', | |||||
'parent', | |||||
'description', | |||||
'isEligibleTicketRestaurant', | |||||
'saleStatus', | |||||
'status', | |||||
]; | |||||
} | |||||
public function configureFields(): array | |||||
{ | |||||
$productCategoryArray = $this->productCategoryStore | |||||
->setSection($this->section) | |||||
->getParents(); | |||||
return [ | |||||
'title' => TextField::new('title')->setSortable(true), | |||||
'position' => NumberField::new('position')->setSortable(true), | |||||
'parent' => AssociationField::new('parent') | |||||
->setFormTypeOption('choices', $productCategoryArray), | |||||
'description' => CKEditorField::new('description'), | |||||
'saleStatus' => ToggleField::new('saleStatus')->setSortable(true), | |||||
'isEligibleTicketRestaurant' => ToggleField::new('isEligibleTicketRestaurant')->setSortable(true), | |||||
]; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Reduction; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class ReductionCartFieldDefinition extends AbstractFieldDefinition | |||||
{ | |||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureFields(): array | |||||
{ | |||||
return [ | |||||
'title' => TextField::new('title')->setSortable(true) | |||||
// @TODO : à faire | |||||
]; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Reduction; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class ReductionCatalogFieldDefinition extends AbstractFieldDefinition | |||||
{ | |||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureFields(): array | |||||
{ | |||||
return [ | |||||
'title' => TextField::new('title')->setSortable(true) | |||||
// @TODO : à faire | |||||
]; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Site; | |||||
use Lc\CaracoleBundle\Definition\Field\FieldDefinitionTrait; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Definition\Field\Site\NewsFieldDefinition as SovNewsFieldDefinition; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class NewsFieldDefinition extends SovNewsFieldDefinition | |||||
{ | |||||
use FieldDefinitionTrait; | |||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureIndex(): array | |||||
{ | |||||
return $this->addSectionToFieldArrayIfOutOfSection($this->section, parent::configureIndex()); | |||||
} | |||||
public function configurePanelMain(): array | |||||
{ | |||||
return array_merge(['section'], parent::configurePanelMain()); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Definition\Field\Site; | |||||
use Lc\CaracoleBundle\Definition\Field\FieldDefinitionTrait; | |||||
use Lc\CaracoleBundle\Repository\Section\SectionStore; | |||||
use Lc\SovBundle\Definition\Field\Site\PageFieldDefinition as SovPageFieldDefinition; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
class PageFieldDefinition extends SovPageFieldDefinition | |||||
{ | |||||
use FieldDefinitionTrait; | |||||
protected SectionStore $sectionStore; | |||||
public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore) | |||||
{ | |||||
parent::__construct($translatorAdmin); | |||||
$this->sectionStore = $sectionStore; | |||||
} | |||||
public function configureIndex(): array | |||||
{ | |||||
return [ | |||||
'id', | |||||
'title', | |||||
'status' | |||||
]; | |||||
} | |||||
} |
class PageFactory extends SovPageFactory | class PageFactory extends SovPageFactory | ||||
{ | { | ||||
use MerchantContextTrait; | |||||
use SectionContextTrait; | use SectionContextTrait; | ||||
public function create(): PageInterface | public function create(): PageInterface | ||||
{ | { | ||||
$page = parent::create(); | $page = parent::create(); | ||||
$page->setMerchant($this->merchant); | |||||
$page->setSection($this->section); | $page->setSection($this->section); | ||||
return $page; | return $page; |
return $this; | return $this; | ||||
} | } | ||||
/** | |||||
* @deprecated Utiliser setFormTypeOption('choices', $choices) avec $choices issu d'un Store. | |||||
*/ | |||||
public function initQueryBuilder(): self | public function initQueryBuilder(): self | ||||
{ | { | ||||
$param = $this->queryBuilderParameters; | $param = $this->queryBuilderParameters; |
use Lc\CaracoleBundle\Repository\Section\SectionRepository; | use Lc\CaracoleBundle\Repository\Section\SectionRepository; | ||||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | use Lc\CaracoleBundle\Resolver\MerchantResolver; | ||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | use Lc\CaracoleBundle\Resolver\SectionResolver; | ||||
use Lc\CaracoleBundle\Solver\Section\SectionSolver; | |||||
use Lc\SovBundle\Doctrine\EntityManager; | use Lc\SovBundle\Doctrine\EntityManager; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Translation\TranslatorAdmin; | use Lc\SovBundle\Translation\TranslatorAdmin; | ||||
class SwitchSectionFormType extends AbstractType | class SwitchSectionFormType extends AbstractType | ||||
{ | { | ||||
protected $em; | |||||
protected $translatorAdmin; | |||||
protected $sectionResolver; | |||||
protected EntityManager $em; | |||||
protected TranslatorAdmin $translatorAdmin; | |||||
protected SectionResolver $sectionResolver; | |||||
protected SectionSolver $sectionSolver; | |||||
public function __construct( | public function __construct( | ||||
EntityManager $em, | EntityManager $em, | ||||
TranslatorAdmin $translatorAdmin, | TranslatorAdmin $translatorAdmin, | ||||
SectionResolver $sectionResolver | |||||
SectionResolver $sectionResolver, | |||||
SectionSolver $sectionSolver | |||||
) { | ) { | ||||
$this->em = $em; | $this->em = $em; | ||||
$this->translatorAdmin = $translatorAdmin; | $this->translatorAdmin = $translatorAdmin; | ||||
$this->sectionResolver = $sectionResolver; | $this->sectionResolver = $sectionResolver; | ||||
$this->sectionSolver = $sectionSolver; | |||||
} | } | ||||
public function buildForm(FormBuilderInterface $builder, array $options) | public function buildForm(FormBuilderInterface $builder, array $options) | ||||
$styleButton = ''; | $styleButton = ''; | ||||
$classButton = 'btn-section'; | $classButton = 'btn-section'; | ||||
if ($section == $currentSection) { | if ($section == $currentSection) { | ||||
$classButton .= ' btn-section-current section-'.$currentSection->getDevAlias(); | |||||
//$styleButton = 'color: white; background-color: ' . $currentSection->getColor() . ';'; | |||||
$classButton .= ' btn-section-current '.$this->sectionSolver->getHtmlClass($currentSection); | |||||
} | } | ||||
$builder->add( | $builder->add( | ||||
'submit', | 'submit', | ||||
SubmitType::class, | SubmitType::class, | ||||
[ | [ | ||||
'label' => $section ? $section->getTitle() : '', | |||||
'label' => $section ? $section->getTitle() : 'Tout afficher', | |||||
'attr' => [ | 'attr' => [ | ||||
'class' => $classButton, | 'class' => $classButton, | ||||
'style' => $styleButton, | 'style' => $styleButton, |
namespace Lc\CaracoleBundle\Model\Site; | namespace Lc\CaracoleBundle\Model\Site; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\SovBundle\Model\Site\PageModel as SovPageModel; | use Lc\SovBundle\Model\Site\PageModel as SovPageModel; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class PageModel extends SovPageModel implements FilterSectionInterface | |||||
abstract class PageModel extends SovPageModel implements FilterMerchantInterface, FilterSectionInterface | |||||
{ | { | ||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | |||||
* @ORM\JoinColumn(nullable=false) | |||||
*/ | |||||
protected $merchant; | |||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="pages") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="pages") | ||||
* @ORM\JoinColumn(nullable=false) | |||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | */ | ||||
protected $section; | protected $section; | ||||
public function getMerchant(): ?MerchantInterface | |||||
{ | |||||
return $this->merchant; | |||||
} | |||||
public function setMerchant(?MerchantInterface $merchant): self | |||||
{ | |||||
$this->merchant = $merchant; | |||||
return $this; | |||||
} | |||||
public function getSection(): SectionInterface | public function getSection(): SectionInterface | ||||
{ | { | ||||
return $this->section; | return $this->section; | ||||
return $this; | return $this; | ||||
} | } | ||||
} | } |
<?php | |||||
namespace Lc\CaracoleBundle\Repository; | |||||
Use Lc\SovBundle\Repository\AbstractStore as SovAbstractStore; | |||||
abstract class AbstractStore extends SovAbstractStore | |||||
{ | |||||
use StoreTrait; | |||||
} |
namespace Lc\CaracoleBundle\Repository\Address; | namespace Lc\CaracoleBundle\Repository\Address; | ||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class AddressStore extends AbstractStore | class AddressStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Config; | namespace Lc\CaracoleBundle\Repository\Config; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | 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; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class TaxRateStore extends AbstractStore | class TaxRateStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Config; | namespace Lc\CaracoleBundle\Repository\Config; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class UnitStore extends AbstractStore | class UnitStore extends AbstractStore |
use App\Entity\User\UserMerchant; | use App\Entity\User\UserMerchant; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use DateTime; | use DateTime; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
namespace Lc\CaracoleBundle\Repository\Distribution; | namespace Lc\CaracoleBundle\Repository\Distribution; | ||||
use App\Entity\Distribution\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; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class DistributionStore extends AbstractStore | class DistributionStore extends AbstractStore |
use Lc\CaracoleBundle\Model\File\DocumentInterface; | use Lc\CaracoleBundle\Model\File\DocumentInterface; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class DocumentStore extends AbstractStore | class DocumentStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Merchant; | 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; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class MerchantStore extends AbstractStore | class MerchantStore extends AbstractStore |
trait MerchantStoreTrait | trait MerchantStoreTrait | ||||
{ | { | ||||
protected MerchantInterface $merchant; | |||||
protected ?MerchantInterface $merchant = null; | |||||
public function setMerchant(MerchantInterface $merchant):self | |||||
public function setMerchant(?MerchantInterface $merchant):self | |||||
{ | { | ||||
$this->merchant = $merchant; | $this->merchant = $merchant; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\StoreTrait; | |||||
use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore; | use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class NewsletterStore extends SovNewsletterStore | class NewsletterStore extends SovNewsletterStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use SectionStoreTrait; | use SectionStoreTrait; | ||||
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderPaymentStore extends AbstractStore | class OrderPaymentStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderProductReductionCatalogStore extends AbstractStore | class OrderProductReductionCatalogStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderProductRefundStore extends AbstractStore | class OrderProductRefundStore extends AbstractStore |
use Lc\CaracoleBundle\Model\Order\OrderStatusModel; | use Lc\CaracoleBundle\Model\Order\OrderStatusModel; | ||||
use Lc\CaracoleBundle\Model\Product\ProductInterface; | use Lc\CaracoleBundle\Model\Product\ProductInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderProductStore extends AbstractStore | class OrderProductStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderReductionCartStore extends AbstractStore | class OrderReductionCartStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderReductionCreditStore extends AbstractStore | class OrderReductionCreditStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderRefundStore extends AbstractStore | class OrderRefundStore extends AbstractStore |
use Lc\CaracoleBundle\Solver\Price\PriceSolver; | use Lc\CaracoleBundle\Solver\Price\PriceSolver; | ||||
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; | use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderStatusHistoryStore extends AbstractStore | class OrderStatusHistoryStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Order; | namespace Lc\CaracoleBundle\Repository\Order; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OrderStatusStore extends AbstractStore | class OrderStatusStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\PointSale; | namespace Lc\CaracoleBundle\Repository\PointSale; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class PointSaleStore extends AbstractStore | class PointSaleStore extends AbstractStore |
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ProductCategoryStore extends AbstractStore | class ProductCategoryStore extends AbstractStore |
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ProductFamilySectionPropertyStore extends AbstractStore | class ProductFamilySectionPropertyStore extends AbstractStore |
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\CaracoleBundle\Solver\Price\PriceSolver; | use Lc\CaracoleBundle\Solver\Price\PriceSolver; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ProductFamilyStore extends AbstractStore | class ProductFamilyStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Product; | namespace Lc\CaracoleBundle\Repository\Product; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ProductStore extends AbstractStore | class ProductStore extends AbstractStore | ||||
public function filtersDefault($query):RepositoryQueryInterface | public function filtersDefault($query):RepositoryQueryInterface | ||||
{ | { | ||||
$this->addFilterBySectionOptionnal($query); | |||||
$query->filterIsOnlineAndOffline(); | $query->filterIsOnlineAndOffline(); | ||||
$query->filterBySection($this->section); | |||||
return $query; | return $query; | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Repository\Product; | namespace Lc\CaracoleBundle\Repository\Product; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class QualityLabelStore extends AbstractStore | class QualityLabelStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Reduction; | 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\Repository\SectionStoreTrait; | ||||
use Lc\CaracoleBundle\Solver\Price\PriceSolver; | use Lc\CaracoleBundle\Solver\Price\PriceSolver; | ||||
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; | 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 Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | |||||
class ReductionCartStore extends AbstractStore | class ReductionCartStore extends AbstractStore | ||||
{ | { |
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ReductionCatalogStore extends AbstractStore | class ReductionCatalogStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Reduction; | 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\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\Order\OrderShopStore; | |||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ReductionCreditStore extends AbstractStore | class ReductionCreditStore extends AbstractStore |
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | 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\Reminder\ReminderStore as SovReminderStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ReminderStore extends SovReminderStore | class ReminderStore extends SovReminderStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use SectionStoreTrait; | use SectionStoreTrait; | ||||
use MerchantStoreTrait; | use MerchantStoreTrait; | ||||
namespace Lc\CaracoleBundle\Repository\Section; | namespace Lc\CaracoleBundle\Repository\Section; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | 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; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class OpeningStore extends AbstractStore | class OpeningStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Section; | namespace Lc\CaracoleBundle\Repository\Section; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\Order\OrderShopStore; | use Lc\CaracoleBundle\Repository\Order\OrderShopStore; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||||
{ | { | ||||
protected ?SectionInterface $section = null; | protected ?SectionInterface $section = null; | ||||
public function setSection(SectionInterface $section):self | |||||
public function setSection(?SectionInterface $section):self | |||||
{ | { | ||||
$this->section = $section; | $this->section = $section; | ||||
namespace Lc\CaracoleBundle\Repository\Setting; | namespace Lc\CaracoleBundle\Repository\Setting; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class MerchantSettingStore extends AbstractStore | class MerchantSettingStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Setting; | namespace Lc\CaracoleBundle\Repository\Setting; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class SectionSettingStore extends AbstractStore | class SectionSettingStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\Site; | namespace Lc\CaracoleBundle\Repository\Site; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\StoreTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Repository\Site\NewsStore as SovNewsStore; | use Lc\SovBundle\Repository\Site\NewsStore as SovNewsStore; | ||||
class NewsStore extends SovNewsStore | class NewsStore extends SovNewsStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use SectionStoreTrait; | use SectionStoreTrait; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterBySection($this->section); | |||||
$this->addFilterBySectionOptionnal($query); | |||||
return parent::filtersDefault($query); | return parent::filtersDefault($query); | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Repository\Site; | namespace Lc\CaracoleBundle\Repository\Site; | ||||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | ||||
use Lc\SovBundle\Repository\Site\PageRepositoryQuery as SovPageRepositoryQuery; | use Lc\SovBundle\Repository\Site\PageRepositoryQuery as SovPageRepositoryQuery; | ||||
class PageRepositoryQuery extends SovPageRepositoryQuery | class PageRepositoryQuery extends SovPageRepositoryQuery | ||||
{ | { | ||||
use MerchantRepositoryQueryTrait; | |||||
use SectionRepositoryQueryTrait; | use SectionRepositoryQueryTrait; | ||||
} | } |
namespace Lc\CaracoleBundle\Repository\Site; | namespace Lc\CaracoleBundle\Repository\Site; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | |||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | 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\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Repository\Site\PageStore as SovPageStore; | use Lc\SovBundle\Repository\Site\PageStore as SovPageStore; | ||||
class PageStore extends SovPageStore | class PageStore extends SovPageStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use MerchantStoreTrait; | |||||
use SectionStoreTrait; | use SectionStoreTrait; | ||||
public function __construct(PageRepositoryQuery $query) | public function __construct(PageRepositoryQuery $query) | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterBySection($this->section); | |||||
$this->addFilterByMerchantOptionnal($query); | |||||
$this->addFilterBySectionOptionnal($query); | |||||
return parent::filtersDefault($query); | return parent::filtersDefault($query); | ||||
} | } | ||||
<?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); | |||||
} | |||||
} | |||||
} |
namespace Lc\CaracoleBundle\Repository\Ticket; | namespace Lc\CaracoleBundle\Repository\Ticket; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | 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\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Repository\Ticket\TicketStore as SovTicketStore; | use Lc\SovBundle\Repository\Ticket\TicketStore as SovTicketStore; | ||||
class TicketStore extends SovTicketStore | class TicketStore extends SovTicketStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use SectionStoreTrait; | use SectionStoreTrait; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterBySection($this->section); | |||||
$this->addFilterBySectionOptionnal($query); | |||||
return $query; | return $query; | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Repository\User; | namespace Lc\CaracoleBundle\Repository\User; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\StoreTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Repository\User\GroupUserStore as SovGroupUserStore; | use Lc\SovBundle\Repository\User\GroupUserStore as SovGroupUserStore; | ||||
class GroupUserStore extends SovGroupUserStore | class GroupUserStore extends SovGroupUserStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use MerchantStoreTrait; | use MerchantStoreTrait; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterByMerchant($this->merchant); | |||||
$this->addFilterByMerchantOptionnal($query); | |||||
return parent::filtersDefault($query); | return parent::filtersDefault($query); | ||||
} | } | ||||
} | } |
namespace Lc\CaracoleBundle\Repository\User; | namespace Lc\CaracoleBundle\Repository\User; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Solver\User\UserMerchantSolver; | use Lc\CaracoleBundle\Solver\User\UserMerchantSolver; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class UserMerchantStore extends AbstractStore | class UserMerchantStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\User; | namespace Lc\CaracoleBundle\Repository\User; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class UserPointSaleStore extends AbstractStore | class UserPointSaleStore extends AbstractStore |
namespace Lc\CaracoleBundle\Repository\User; | namespace Lc\CaracoleBundle\Repository\User; | ||||
use App\Entity\Newsletter\Newsletter; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\StoreTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Repository\User\UserStore as SovUserStore; | use Lc\SovBundle\Repository\User\UserStore as SovUserStore; | ||||
class UserStore extends SovUserStore | class UserStore extends SovUserStore | ||||
{ | { | ||||
use StoreTrait; | |||||
use MerchantStoreTrait; | use MerchantStoreTrait; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->filterByMerchant($this->merchant); | |||||
$this->addFilterByMerchantOptionnal($query); | |||||
return $query; | return $query; | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Repository\User; | namespace Lc\CaracoleBundle\Repository\User; | ||||
use Lc\SovBundle\Repository\AbstractStore; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class VisitorStore extends AbstractStore | class VisitorStore extends AbstractStore |
class SectionResolver | class SectionResolver | ||||
{ | { | ||||
protected bool $isCachedSection = false; | |||||
protected ?SectionInterface $section = null; | protected ?SectionInterface $section = null; | ||||
protected EntityManagerInterface $entityManager; | protected EntityManagerInterface $entityManager; | ||||
// admin | // admin | ||||
if (isset($requestAttributesArray['easyadmin_context'])) { | if (isset($requestAttributesArray['easyadmin_context'])) { | ||||
if ($this->section === null) { | |||||
if (!$this->isCachedSection) { | |||||
$currentAdminSection = null; | $currentAdminSection = null; | ||||
$userMerchant = $this->merchantResolver->getUserMerchant(); | $userMerchant = $this->merchantResolver->getUserMerchant(); | ||||
$currentAdminSection = $userMerchant->getCurrentAdminSection(); | $currentAdminSection = $userMerchant->getCurrentAdminSection(); | ||||
} | } | ||||
if ($currentAdminSection === null) { | |||||
/*if ($currentAdminSection === null) { | |||||
$currentAdminSection = $this->sectionStore | $currentAdminSection = $this->sectionStore | ||||
->setMerchant($userMerchant->getMerchant()) | ->setMerchant($userMerchant->getMerchant()) | ||||
->getOneDefault(); | ->getOneDefault(); | ||||
if ($currentAdminSection === null) { | if ($currentAdminSection === null) { | ||||
throw new \ErrorException('Aucune section par défaut définie pour ce merchant'); | throw new \ErrorException('Aucune section par défaut définie pour ce merchant'); | ||||
} | } | ||||
} | |||||
}*/ | |||||
$this->isCachedSection = true; | |||||
$this->section = $currentAdminSection; | $this->section = $currentAdminSection; | ||||
return $currentAdminSection; | return $currentAdminSection; | ||||
}else{ | }else{ | ||||
return $this->section; | return $this->section; | ||||
} | } | ||||
} | } | ||||
public function isOutOfSection(): bool | |||||
{ | |||||
return $this->getCurrent() == null; | |||||
} | |||||
public function getDefault(): SectionInterface | public function getDefault(): SectionInterface | ||||
{ | { | ||||
return $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOneDefault(); | return $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOneDefault(); |
taxRate: Règle de taxe | taxRate: Règle de taxe | ||||
merchants: Marchands | merchants: Marchands | ||||
sections: Sections | sections: Sections | ||||
section: Section | |||||
behaviorTaxRate: Avec ou sans TVA | behaviorTaxRate: Avec ou sans TVA | ||||
behaviorTaxRateChoices: | behaviorTaxRateChoices: | ||||
tax-excluded: TVA exclue | tax-excluded: TVA exclue | ||||
priceWithTax: Prix de vente | priceWithTax: Prix de vente | ||||
sales: Historique des ventes | sales: Historique des ventes | ||||
propertyQualityLabelActive: Marquer le produit comme labellisé | propertyQualityLabelActive: Marquer le produit comme labellisé | ||||
productFamilySectionProperties: Sections | |||||
QualityLabel: | QualityLabel: | ||||
label: Label de qualité | label: Label de qualité |
{% import '@LcCaracole/admin/product/macro/product_family_macro.html.twig' as pfm %} | {% import '@LcCaracole/admin/product/macro/product_family_macro.html.twig' as pfm %} | ||||
{% set section_current = section_container.resolver.getCurrent() %} | {% set section_current = section_container.resolver.getCurrent() %} | ||||
{{ pfm.product_family_sales_statistic(order_shop_container.builder.getProductsSalesStatistic(section_current, entity.instance, 2), entity.instance) }} | |||||
{% if section_current %} | |||||
{{ pfm.product_family_sales_statistic(order_shop_container.builder.getProductsSalesStatistic(section_current, entity.instance, 2), entity.instance) }} | |||||
{% endif %} |
{% import '@LcCaracole/admin/section/macros.html.twig' as macros_section %} | |||||
{% set item = entity.instance %} | |||||
{% for section_property in item.productFamilySectionProperties %} | |||||
{{ macros_section.section_badge(section_property.section) }} | |||||
{% else %} | |||||
<span class="badge badge-secondary">Aucune</span> | |||||
{% endfor %} |
{% import '@LcCaracole/admin/section/macros.html.twig' as macros_section %} | |||||
{% set item = entity.instance %} | |||||
{% if item.section %} | |||||
{{ macros_section.section_badge(item.section) }} | |||||
{% else %} | |||||
<span class="badge badge-secondary">Aucune</span> | |||||
{% endif %} |
{% import '@LcCaracole/admin/section/macros.html.twig' as macros_section %} | |||||
{% set item = entity.instance %} | |||||
{% for section in item.sections %} | |||||
{{ macros_section.section_badge(section) }} | |||||
{% else %} | |||||
<span class="badge badge-secondary">Aucune</span> | |||||
{% endfor %} |
{% macro section_badge(section) %} | |||||
<span class="badge badge-secondary {{ section_container.solver.getHtmlClass(section) }}">{{ section.title }}</span> | |||||
{% endmacro %} |
{% extends '@LcCaracole/adminlte/layout.html.twig' %} | {% extends '@LcCaracole/adminlte/layout.html.twig' %} | ||||
{% block content_title %} | {% block content_title %} | ||||
{% set current_section = resolver.getCurrent() %} | |||||
Paramètres section > {{ current_section.title }} | |||||
{% if resolver is defined %}{% set current_section = resolver.getCurrent() %}{% endif %} | |||||
Paramètres section{% if current_section is defined and current_section %} > {{ current_section.title }}{% endif %} | |||||
{% endblock %} | {% endblock %} | ||||
{% block main %} | {% block main %} |
{% set section_current = section_current() %} | {% set section_current = section_current() %} | ||||
{% set is_display_switch_section = display_switch_section is defined and display_switch_section %} | {% set is_display_switch_section = display_switch_section is defined and display_switch_section %} | ||||
<nav class="carac navbar navbar-expand navbar-light main-header{% if is_display_switch_section %} display-section-switch section-{{ section_current.devAlias }}{% endif %}"> | |||||
<nav class="carac navbar navbar-expand navbar-light main-header{% if is_display_switch_section %} display-section-switch {{ section_container.solver.getHtmlClass(section_current()) }}{% endif %}"> | |||||
{% if is_display_switch_section %} | {% if is_display_switch_section %} | ||||
<ul class="navbar-nav left"> | <ul class="navbar-nav left"> | ||||
<li class="nav-item d-none d-sm-inline-block"> | |||||
{{ _self.form_switch_section(null) }} | |||||
</li> | |||||
{% for section in carac_sections() %} | {% for section in carac_sections() %} | ||||
<li class="nav-item d-none d-sm-inline-block"> | <li class="nav-item d-none d-sm-inline-block"> | ||||
{% set form_switch_section = carac_form_switch_section(section) %} | |||||
{% form_theme form_switch_section '@LcSov/adminlte/crud/form_theme.html.twig' %} | |||||
{{ form_start(form_switch_section) }} | |||||
{{ form(form_switch_section) }} | |||||
{{ form_end(form_switch_section) }} | |||||
{{ _self.form_switch_section(section) }} | |||||
</li> | </li> | ||||
{% endfor %} | {% endfor %} | ||||
</ul> | </ul> | ||||
{% include '@LcSov/admin/reminder/block.html.twig' %} | {% include '@LcSov/admin/reminder/block.html.twig' %} | ||||
{% endblock %} | {% endblock %} | ||||
{% block append_body %} | {% block append_body %} | ||||
{# modal switch merchant #} | {# modal switch merchant #} | ||||
{% set user = app.user %} | {% set user = app.user %} | ||||
{# modal affichée uniquement si la sessionStorage.visit_merchant n'est pas défini (js) #} | {# modal affichée uniquement si la sessionStorage.visit_merchant n'est pas défini (js) #} | ||||
{% include '@LcCaracole/admin/merchant/modal/switch_merchant.html.twig' %} | {% include '@LcCaracole/admin/merchant/modal/switch_merchant.html.twig' %} | ||||
{% endif %} | {% endif %} | ||||
{% endblock %} | |||||
{% endblock %} | |||||
{% macro form_switch_section(section) %} | |||||
{% set form_switch_section = carac_form_switch_section(section) %} | |||||
{% form_theme form_switch_section '@LcSov/adminlte/crud/form_theme.html.twig' %} | |||||
{{ form_start(form_switch_section) }} | |||||
{{ form(form_switch_section) }} | |||||
{{ form_end(form_switch_section) }} | |||||
{% endmacro %} |
class SectionSolver | class SectionSolver | ||||
{ | { | ||||
public function getHtmlClass(?SectionInterface $section): string | |||||
{ | |||||
$htmlClass = 'section-'; | |||||
$htmlClass .= $section ? $section->getDevAlias() : 'all'; | |||||
return $htmlClass; | |||||
} | |||||
} | } |
return $this->merchantStore->getOnline(); | return $this->merchantStore->getOnline(); | ||||
} | } | ||||
public function getSectionCurrent(): SectionInterface | |||||
public function getSectionCurrent(): ?SectionInterface | |||||
{ | { | ||||
return $this->sectionResolver->getCurrent(); | return $this->sectionResolver->getCurrent(); | ||||
} | } |