|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Twig; |
|
|
namespace Lc\ShopBundle\Twig; |
|
|
|
|
|
|
|
|
|
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
use Lc\ShopBundle\Context\PageInterface; |
|
|
use Lc\ShopBundle\Context\PageInterface; |
|
|
use Lc\ShopBundle\Form\Frontend\NewsletterType; |
|
|
use Lc\ShopBundle\Form\Frontend\NewsletterType; |
|
|
use Lc\ShopBundle\Services\TaxRateUtils; |
|
|
use Lc\ShopBundle\Services\TaxRateUtils; |
|
|
|
|
|
|
|
|
class BridgeTwigExtension extends AbstractExtension |
|
|
class BridgeTwigExtension extends AbstractExtension |
|
|
{ |
|
|
{ |
|
|
private $utils ; |
|
|
private $utils ; |
|
|
private $taxRateUtils ; |
|
|
|
|
|
private $unitUtils ; |
|
|
|
|
|
|
|
|
private $merchantUtils ; |
|
|
|
|
|
|
|
|
public function __construct(Utils $utils, TaxRateUtils $taxRateUtils, UnitUtils $unitUtils) |
|
|
|
|
|
|
|
|
public function __construct(Utils $utils, MerchantUtilsInterface $merchantUtils) |
|
|
{ |
|
|
{ |
|
|
$this->utils = $utils ; |
|
|
$this->utils = $utils ; |
|
|
$this->taxRateUtils = $taxRateUtils ; |
|
|
|
|
|
$this->unitUtils = $unitUtils ; |
|
|
|
|
|
|
|
|
$this->merchantUtils = $merchantUtils ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getFunctions() |
|
|
public function getFunctions() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getUnitsList() |
|
|
public function getUnitsList() |
|
|
{ |
|
|
{ |
|
|
return $this->unitUtils->getUnitsList() ; |
|
|
|
|
|
|
|
|
return $this->utils->getUnitsList() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getTaxRatesList() |
|
|
public function getTaxRatesList() |
|
|
{ |
|
|
{ |
|
|
return $this->taxRateUtils->getTaxRatesList() ; |
|
|
|
|
|
|
|
|
return $this->merchantUtils->getTaxRatesList() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getElementByDevAlias($devAlias, $class = PageInterface::class) |
|
|
public function getElementByDevAlias($devAlias, $class = PageInterface::class) |