You are here

function currency_delete in Currency 7.2

Deletes a currency.

Parameters

Currency|string $currency: A Currency object, or the currency's ISO 4217 code.

Return value

Currency

1 call to currency_delete()
CurrencyCRUDWebTestCase::testCRUD in currency/tests/CurrencyCRUDWebTestCase.test
Test CRUD functionality.
1 string reference to 'currency_delete'
currency_schema in currency/currency.install
Implements hook_schema().

File

currency/currency.module, line 736
Provides currency information and allows users to add custom currencies.

Code

function currency_delete($currency) {
  $currency_code = is_object($currency) ? $currency->ISO4217Code : $currency;
  if (module_exists('i18n_string')) {
    $currency = is_object($currency) ? $currency : currency_load($currency_code);
    i18n_string_object_remove('currency', $currency);
  }
  db_delete('currency')
    ->condition('ISO4217Code', $currency_code)
    ->execute();
}