Ви не можете вибрати більше 25 тем
Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
|
- <?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;
- }
- }
|