PHP Class WellCommerce\Bundle\CurrencyBundle\Importer\AbstractExchangeRatesImporter

Author: Adam Piotrowski ([email protected])
Show file Open project: wellcommerce/wellcommerce

Protected Properties

Property Type Description
$currencyRepository WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRepositoryInterface
$helper WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface
$managedCurrencies array
$ratesRepository WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRateRepositoryInterface

Public Methods

Method Description
__construct ( WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRepositoryInterface $currencyRepository, WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRateRepositoryInterface $ratesRepository, WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface $helper ) Constructor

Protected Methods

Method Description
addUpdateExchangeRate ( string $currencyFrom, string $currencyTo, float $rate ) Adds new rate or updates existing one
formatExchangeRate ( float $rate ) : string Formats the exchange rate
getCurrencies ( ) : Currency[] Returns all currencies from repository
setManagedCurrencies ( ) Sets all managed currencies

Method Details

__construct() public method

Constructor
public __construct ( WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRepositoryInterface $currencyRepository, WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRateRepositoryInterface $ratesRepository, WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface $helper )
$currencyRepository WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRepositoryInterface
$ratesRepository WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRateRepositoryInterface
$helper WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface

addUpdateExchangeRate() protected method

Adds new rate or updates existing one
protected addUpdateExchangeRate ( string $currencyFrom, string $currencyTo, float $rate )
$currencyFrom string
$currencyTo string
$rate float

formatExchangeRate() protected method

Formats the exchange rate
protected formatExchangeRate ( float $rate ) : string
$rate float
return string

getCurrencies() protected method

Returns all currencies from repository
protected getCurrencies ( ) : Currency[]
return WellCommerce\Bundle\CurrencyBundle\Entity\Currency[]

setManagedCurrencies() protected method

Sets all managed currencies
protected setManagedCurrencies ( )

Property Details

$currencyRepository protected property

protected CurrencyRepositoryInterface,WellCommerce\Bundle\CurrencyBundle\Repository $currencyRepository
return WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRepositoryInterface

$helper protected property

protected DoctrineHelperInterface,WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine $helper
return WellCommerce\Bundle\DoctrineBundle\Helper\Doctrine\DoctrineHelperInterface

$managedCurrencies protected property

protected array $managedCurrencies
return array

$ratesRepository protected property

protected CurrencyRateRepositoryInterface,WellCommerce\Bundle\CurrencyBundle\Repository $ratesRepository
return WellCommerce\Bundle\CurrencyBundle\Repository\CurrencyRateRepositoryInterface