Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- <?php
-
- namespace Lc\ShopBundle\Services ;
-
- use Doctrine\ORM\EntityManagerInterface;
- use Lc\ShopBundle\Context\MerchantUtilsInterface;
- use Lc\ShopBundle\Context\TaxRateInterface;
-
- class TaxRateUtils
- {
- protected $em ;
- protected $merchantUtils ;
-
- public function __construct(EntityManagerInterface $em, MerchantUtilsInterface $merchantUtils)
- {
- $this->em = $em ;
- $this->merchantUtils = $merchantUtils ;
- }
-
- public function getTaxRatesList()
- {
- $taxRatesList =array();
- $taxRates = $this->em->getRepository(TaxRateInterface::class)->findAll();
- foreach ($taxRates as $taxRate){
- $taxRatesList[$taxRate->getId()]['title'] = $taxRate->getTitle();
- $taxRatesList[$taxRate->getId()]['value'] = $taxRate->getValue();
- }
-
- $taxRatesList['default']['title'] = $this->merchantUtils->getMerchantCurrentTaxRate()->getTitle();
- $taxRatesList['default']['value'] = $this->merchantUtils->getMerchantCurrentTaxRate()->getValue();
- return $taxRatesList;
- }
- }
|