merchantResolver = $merchantResolver; $this->sectionResolver = $sectionResolver; $this->merchantRepositoryQuery = $merchantRepositoryQuery; $this->sectionRepositoryQuery = $sectionRepositoryQuery; $this->reminderStore = $reminderStore; $this->unitStore = $unitStore; $this->taxRateStore = $taxRateStore; } public function getFunctions() { return array( new TwigFunction('carac_sections', [$this, 'getSections']), 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']), ); } public function getSections() { return $this->sectionRepositoryQuery ->filterByMerchant($this->merchantResolver->getCurrent()) ->find(); } public function getMerchants() { return $this->merchantRepositoryQuery->find(); } 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->getAsArray(); } }