PHP Class WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelper

Author: Adam Piotrowski ([email protected])
Inheritance: implements WellCommerce\Bundle\CurrencyBundle\Helper\CurrencyHelperInterface
Show file Open project: wellcommerce/wellcommerce

Public Methods

Method Description
__construct ( WellCommerce\Bundle\CurrencyBundle\Converter\CurrencyConverterInterface $converter, WellCommerce\Bundle\CurrencyBundle\Formatter\CurrencyFormatterInterface $formatter ) Constructor
convert ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1 ) : float
convertAndFormat ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1, string $locale = null ) : string
format ( float $amount, string $currency = null, string $locale = null ) : string
getCurrencyRate ( string $baseCurrency = null, string $targetCurrency = null ) : float

Method Details

__construct() public method

Constructor
public __construct ( WellCommerce\Bundle\CurrencyBundle\Converter\CurrencyConverterInterface $converter, WellCommerce\Bundle\CurrencyBundle\Formatter\CurrencyFormatterInterface $formatter )
$converter WellCommerce\Bundle\CurrencyBundle\Converter\CurrencyConverterInterface
$formatter WellCommerce\Bundle\CurrencyBundle\Formatter\CurrencyFormatterInterface

convert() public method

public convert ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1 ) : float
$amount float
$baseCurrency string
$targetCurrency string
$quantity integer
return float

convertAndFormat() public method

public convertAndFormat ( float $amount, string $baseCurrency = null, string $targetCurrency = null, integer $quantity = 1, string $locale = null ) : string
$amount float
$baseCurrency string
$targetCurrency string
$quantity integer
$locale string
return string

format() public method

public format ( float $amount, string $currency = null, string $locale = null ) : string
$amount float
$currency string
$locale string
return string

getCurrencyRate() public method

public getCurrencyRate ( string $baseCurrency = null, string $targetCurrency = null ) : float
$baseCurrency string
$targetCurrency string
return float