You are here

class PriceExchangerCalculator in Commerce Currency Resolver 8

Class PriceExchangerCalculator.

@package Drupal\commerce_currency_resolver

Hierarchy

Expanded class hierarchy of PriceExchangerCalculator

1 string reference to 'PriceExchangerCalculator'
commerce_currency_resolver.services.yml in ./commerce_currency_resolver.services.yml
commerce_currency_resolver.services.yml
1 service uses PriceExchangerCalculator
commerce_currency_resolver.calculator in ./commerce_currency_resolver.services.yml
Drupal\commerce_currency_resolver\PriceExchangerCalculator

File

src/PriceExchangerCalculator.php, line 12

Namespace

Drupal\commerce_currency_resolver
View source
class PriceExchangerCalculator extends AbstractExchangerCalculator {

  /**
   * {@inheritdoc}
   */
  public function getExchangerId() {
    $resolver_exchanger_id = $this->configFactory
      ->get('commerce_currency_resolver.settings')
      ->get('currency_exchange_rates');
    if (isset($this->providers[$resolver_exchanger_id]) && $this->providers[$resolver_exchanger_id]
      ->status()) {
      return $this->providers[$resolver_exchanger_id]
        ->getExchangerConfigName();
    }
    return NULL;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractExchangerCalculator::$configFactory protected property Config factory.
AbstractExchangerCalculator::$entityTypeManager protected property Entity manager.
AbstractExchangerCalculator::$providers protected property List of providers.
AbstractExchangerCalculator::$rounder protected property Drupal commerce price rounder service.
AbstractExchangerCalculator::getExchangeRates public function Get all exchange rates. Overrides ExchangerCalculatorInterface::getExchangeRates
AbstractExchangerCalculator::priceConversion public function Preform currency conversion for prices. Overrides ExchangerCalculatorInterface::priceConversion
AbstractExchangerCalculator::__construct public function DefaultExchangerCalculator constructor.
PriceExchangerCalculator::getExchangerId public function Return configuration file of active provider or NULL. Overrides ExchangerCalculatorInterface::getExchangerId