You are here

public function AbstractExchangerCalculator::__construct in Commerce Exchanger 8

DefaultExchangerCalculator constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager.

\Drupal\Core\Config\ConfigFactory $config_factory: Drupal config factory.

\Drupal\commerce_price\RounderInterface $rounder: Drupal commerce price rounder service.

File

src/AbstractExchangerCalculator.php, line 56

Class

AbstractExchangerCalculator
Class AbstractExchangerCalculator.

Namespace

Drupal\commerce_exchanger

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactory $config_factory, RounderInterface $rounder) {
  $this->configFactory = $config_factory;
  $this->providers = $entity_type_manager
    ->getStorage('commerce_exchange_rates')
    ->loadMultiple();
  $this->rounder = $rounder;
}