PHP Class WellCommerce\Bundle\CurrencyBundle\Twig\Extension\CurrencyExtension

Author: Adam Piotrowski ([email protected])
Inheritance: extends Twig_Extension, implements Twig_Extension_GlobalsInterface
Show file Open project: wellcommerce/wellcommerce

Protected Properties

Property Type Description
$dataset WellCommerce\Component\DataSet\DataSetInterface
$helper WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface

Public Methods

Method Description
__construct ( WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface $helper, WellCommerce\Component\DataSet\DataSetInterface $dataset ) Constructor
convertPrice ( float $price, null | string $baseCurrency = null, null | string $targetCurrency = null, integer $quantity = 1 ) : string Converts the given amount
formatPrice ( float $price, null | string $baseCurrency = null, null | string $targetCurrency = null, null | string $locale = null, $quantity = 1 ) : string Formats the given amount
getCurrencies ( ) : array Returns an array of currencies
getFunctions ( )
getName ( )

Method Details

__construct() public method

Constructor
public __construct ( WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface $helper, WellCommerce\Component\DataSet\DataSetInterface $dataset )
$helper WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface
$dataset WellCommerce\Component\DataSet\DataSetInterface

convertPrice() public method

Converts the given amount
public convertPrice ( float $price, null | string $baseCurrency = null, null | string $targetCurrency = null, integer $quantity = 1 ) : string
$price float
$baseCurrency null | string
$targetCurrency null | string
$quantity integer
return string

formatPrice() public method

Formats the given amount
public formatPrice ( float $price, null | string $baseCurrency = null, null | string $targetCurrency = null, null | string $locale = null, $quantity = 1 ) : string
$price float
$baseCurrency null | string
$targetCurrency null | string
$locale null | string
return string

getCurrencies() public method

Returns an array of currencies
public getCurrencies ( ) : array
return array

getFunctions() public method

public getFunctions ( )

getName() public method

public getName ( )

Property Details

$dataset protected property

protected DataSetInterface,WellCommerce\Component\DataSet $dataset
return WellCommerce\Component\DataSet\DataSetInterface

$helper protected property

protected CurrencyHelperInterface,WellCommerce\Bundle\CurrencyBundle\Helper $helper
return WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface