|
|
|
|
|
|
|
|
use Lc\CaracoleBundle\Repository\Config\UnitStore; |
|
|
use Lc\CaracoleBundle\Repository\Config\UnitStore; |
|
|
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepositoryQuery; |
|
|
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepositoryQuery; |
|
|
use Lc\CaracoleBundle\Repository\Merchant\MerchantStore; |
|
|
use Lc\CaracoleBundle\Repository\Merchant\MerchantStore; |
|
|
|
|
|
use Lc\CaracoleBundle\Repository\Product\ProductCategoryStore; |
|
|
use Lc\CaracoleBundle\Repository\Reminder\ReminderStore; |
|
|
use Lc\CaracoleBundle\Repository\Reminder\ReminderStore; |
|
|
use Lc\CaracoleBundle\Repository\Section\SectionRepository; |
|
|
use Lc\CaracoleBundle\Repository\Section\SectionRepository; |
|
|
use Lc\CaracoleBundle\Repository\Section\SectionRepositoryInterface; |
|
|
use Lc\CaracoleBundle\Repository\Section\SectionRepositoryInterface; |
|
|
|
|
|
|
|
|
protected SectionResolver $sectionResolver; |
|
|
protected SectionResolver $sectionResolver; |
|
|
protected UnitStore $unitStore; |
|
|
protected UnitStore $unitStore; |
|
|
protected TaxRateStore $taxRateStore; |
|
|
protected TaxRateStore $taxRateStore; |
|
|
|
|
|
protected ProductCategoryStore $productCategoryStore; |
|
|
|
|
|
|
|
|
public function __construct( |
|
|
public function __construct( |
|
|
MerchantResolver $merchantResolver, |
|
|
MerchantResolver $merchantResolver, |
|
|
|
|
|
|
|
|
SectionStore $sectionStore, |
|
|
SectionStore $sectionStore, |
|
|
ReminderStore $reminderStore, |
|
|
ReminderStore $reminderStore, |
|
|
UnitStore $unitStore, |
|
|
UnitStore $unitStore, |
|
|
TaxRateStore $taxRateStore |
|
|
|
|
|
|
|
|
TaxRateStore $taxRateStore, |
|
|
|
|
|
ProductCategoryStore $productCategoryStore |
|
|
) { |
|
|
) { |
|
|
$this->merchantResolver = $merchantResolver; |
|
|
$this->merchantResolver = $merchantResolver; |
|
|
$this->sectionResolver = $sectionResolver; |
|
|
$this->sectionResolver = $sectionResolver; |
|
|
|
|
|
|
|
|
$this->reminderStore = $reminderStore; |
|
|
$this->reminderStore = $reminderStore; |
|
|
$this->unitStore = $unitStore; |
|
|
$this->unitStore = $unitStore; |
|
|
$this->taxRateStore = $taxRateStore; |
|
|
$this->taxRateStore = $taxRateStore; |
|
|
|
|
|
$this->productCategoryStore = $productCategoryStore; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getFunctions() |
|
|
public function getFunctions() |
|
|
{ |
|
|
{ |
|
|
return array( |
|
|
return array( |
|
|
new TwigFunction('carac_sections', [$this, 'getSections']), |
|
|
new TwigFunction('carac_sections', [$this, 'getSections']), |
|
|
|
|
|
new TwigFunction('carac_section_current', [$this, 'getSectionCurrent']), |
|
|
new TwigFunction('carac_merchants', [$this, 'getMerchants']), |
|
|
new TwigFunction('carac_merchants', [$this, 'getMerchants']), |
|
|
new TwigFunction('carac_reminders', [$this, 'getReminders']), |
|
|
new TwigFunction('carac_reminders', [$this, 'getReminders']), |
|
|
new TwigFunction('carac_units', [$this, 'getUnits']), |
|
|
new TwigFunction('carac_units', [$this, 'getUnits']), |
|
|
new TwigFunction('carac_tax_rates', [$this, 'getTaxRates']), |
|
|
new TwigFunction('carac_tax_rates', [$this, 'getTaxRates']), |
|
|
new TwigFunction('carac_reduction_cart_codes', [$this, 'getTaxRates']), |
|
|
new TwigFunction('carac_reduction_cart_codes', [$this, 'getTaxRates']), |
|
|
|
|
|
new TwigFunction('carac_product_categories', [$this, 'getProductCategories']), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getProductCategories() |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->productCategoryStore->getParent(false); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function getSections() |
|
|
public function getSections() |
|
|
{ |
|
|
{ |
|
|
return $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOnline(); |
|
|
return $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOnline(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getSectionCurrent() |
|
|
|
|
|
{ |
|
|
|
|
|
return $this->sectionResolver->getCurrentFrontend(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function getMerchants() |
|
|
public function getMerchants() |
|
|
{ |
|
|
{ |
|
|
return $this->merchantStore->getOnline(); |
|
|
return $this->merchantStore->getOnline(); |