You are here

public function Currency::resourceLoad in Currency 7.2

Loads a currency resource into this object.

Parameters

string $iso_4217_code:

File

currency/vendor/bartfeenstra/currency/src/BartFeenstra/Currency/Currency.php, line 119
Contains class \BartFeenstra\Currency\Currency.

Class

Currency
Describes a currency.

Namespace

BartFeenstra\Currency

Code

public function resourceLoad($iso_4217_code) {
  $filepath = self::resourceDir() . "{$iso_4217_code}.yml";
  if (is_readable($filepath)) {
    $this
      ->resourceParse(file_get_contents($filepath));
  }
  else {
    throw new \RuntimeException(sprintf('The currency resource file %s does not exist or is not readable.', $filepath));
  }
}