You are here

class DefaultExchangerCalculator in Commerce Exchanger 8

Hierarchy

Expanded class hierarchy of DefaultExchangerCalculator

1 string reference to 'DefaultExchangerCalculator'
commerce_exchanger.services.yml in ./commerce_exchanger.services.yml
commerce_exchanger.services.yml
1 service uses DefaultExchangerCalculator
commerce_exchanger.calculate in ./commerce_exchanger.services.yml
Drupal\commerce_exchanger\DefaultExchangerCalculator

File

src/DefaultExchangerCalculator.php, line 5

Namespace

Drupal\commerce_exchanger
View source
class DefaultExchangerCalculator extends AbstractExchangerCalculator {

  /**
   * {@inheritdoc}
   */
  public function getExchangerId() {

    // Return the first one.
    foreach ($this->providers as $provider) {
      if ($provider
        ->status()) {
        return $provider
          ->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.
DefaultExchangerCalculator::getExchangerId public function Return configuration file of active provider or NULL. Overrides ExchangerCalculatorInterface::getExchangerId