Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
|
- <?php
-
- namespace Lc\CaracoleBundle\Repository\Config;
-
- use Lc\CaracoleBundle\Resolver\MerchantResolver;
- use Lc\SovBundle\Repository\AbstractStore;
-
- class TaxRateStore extends AbstractStore
- {
- protected TaxRateRepositoryQuery $query;
- protected MerchantResolver $merchantResolver;
-
- public function __construct(TaxRateRepositoryQuery $query, MerchantResolver $merchantResolver)
- {
- $this->query = $query;
- $this->merchantResolver = $merchantResolver;
- }
-
-
- public function getAsArray()
- {
- $query = $this->query->create();
-
- $taxRatesList = array();
- foreach ($query->find() as $taxRate) {
- $taxRatesList[$taxRate->getId()]['title'] = $taxRate->getTitle();
- $taxRatesList[$taxRate->getId()]['value'] = $taxRate->getValue();
- }
-
- $taxRatesList['default']['title'] = $this->merchantResolver->getCurrent()->getTaxRate()->getTitle();
- $taxRatesList['default']['value'] = $this->merchantResolver->getCurrent()->getTaxRate()->getValue();
-
- return $taxRatesList;
- }
- }
|