merchantResolver = $merchantResolver; $this->sectionResolver = $sectionResolver; $this->merchantStore = $merchantStore; $this->sectionStore = $sectionStore; $this->reminderStore = $reminderStore; $this->unitStore = $unitStore; $this->taxRateStore = $taxRateStore; $this->productCategoryStore = $productCategoryStore; } public function getFunctions() { return array( new TwigFunction('carac_sections', [$this, 'getSections']), new TwigFunction('carac_section_current', [$this, 'getSectionCurrent']), new TwigFunction('carac_merchants', [$this, 'getMerchants']), new TwigFunction('carac_reminders', [$this, 'getReminders']), new TwigFunction('carac_units', [$this, 'getUnits']), new TwigFunction('carac_tax_rates', [$this, 'getTaxRates']), new TwigFunction('carac_reduction_cart_codes', [$this, 'getTaxRates']), new TwigFunction('carac_product_categories', [$this, 'getProductCategories']), ); } public function getProductCategories() { return $this->productCategoryStore ->setSection($this->sectionResolver->getCurrent()) ->getParent(false); } public function getSections() { return $this->sectionStore ->setMerchant($this->merchantResolver->getCurrent()) ->getOnline(); } public function getSectionCurrent() { return $this->sectionResolver->getCurrent(); } public function getMerchants() { return $this->merchantStore->getOnline(); } public function getReminders($params = []) { return $this->reminderStore ->setMerchant($this->merchantResolver->getCurrent()) ->setSection($this->sectionResolver->getCurrent()) ->get($params); } public function getUnits() { return $this->unitStore->getAsArray(); } public function getTaxRates() { return $this->taxRateStore->setMerchant($this->merchantResolver->getCurrent())->getAsArray(); } public function getReductionCartCodes() { //TODO mettre à jour une fois les repo fait return array(); } }