You are here

interface CurrencyImporterInterface in Price 3.x

Same name and namespace in other branches
  1. 8 src/CurrencyImporterInterface.php \Drupal\price\CurrencyImporterInterface
  2. 2.0.x src/CurrencyImporterInterface.php \Drupal\price\CurrencyImporterInterface
  3. 2.x src/CurrencyImporterInterface.php \Drupal\price\CurrencyImporterInterface
  4. 3.0.x src/CurrencyImporterInterface.php \Drupal\price\CurrencyImporterInterface

Imports the library-provided currency data into config entities.

Hierarchy

Expanded class hierarchy of CurrencyImporterInterface

All classes that implement CurrencyImporterInterface

1 file declares its use of CurrencyImporterInterface
CurrencyImportForm.php in src/Form/CurrencyImportForm.php

File

src/CurrencyImporterInterface.php, line 8

Namespace

Drupal\price
View source
interface CurrencyImporterInterface {

  /**
   * Gets a list of importable currencies.
   *
   * @return array
   *   An array in the currencyCode => name format.
   */
  public function getImportable();

  /**
   * Imports currency data for the given currency code.
   *
   * @param string $currency_code
   *   The currency code.
   *
   * @return \Drupal\price\Entity\CurrencyInterface
   *   The saved currency entity.
   *
   * @throws \CommerceGuys\Intl\Exception\UnknownCurrencyException
   *   Thrown when the currency couldn't be found in the library definitions.
   */
  public function import($currency_code);

  /**
   * Imports currency data for the given country code.
   *
   * @param string $country_code
   *   The country code.
   *
   * @return \Drupal\price\Entity\CurrencyInterface|null
   *   The saved currency entity or NULL if the given country's currency
   *   isn't known.
   *
   * @throws \CommerceGuys\Intl\Exception\UnknownCountryException
   *   Thrown when the country couldn't be found in the library definitions.
   */
  public function importByCountry($country_code);

  /**
   * Imports translations for the given language codes.
   *
   * @param array $langcodes
   *   Array of language codes to import translations for.
   */
  public function importTranslations(array $langcodes);

}

Members

Namesort descending Modifiers Type Description Overrides
CurrencyImporterInterface::getImportable public function Gets a list of importable currencies. 1
CurrencyImporterInterface::import public function Imports currency data for the given currency code. 1
CurrencyImporterInterface::importByCountry public function Imports currency data for the given country code. 1
CurrencyImporterInterface::importTranslations public function Imports translations for the given language codes. 1