You are here

protected function ExchangeRatesForm::setExchangeRates in Commerce Exchanger 8

1 call to ExchangeRatesForm::setExchangeRates()
ExchangeRatesForm::submitForm in src/Form/ExchangeRatesForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…

File

src/Form/ExchangeRatesForm.php, line 293

Class

ExchangeRatesForm
Class ExchangeRateForm.

Namespace

Drupal\commerce_exchanger\Form

Code

protected function setExchangeRates(array $exchange_rates, string $name) {
  $config = $this->configFactory
    ->getEditable($name)
    ->setData([
    'rates' => $exchange_rates,
  ]);
  $config
    ->save();
}