You are here

function country_delete in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.module \country_delete()

Delete a countries object from the database.

Parameters

string $iso2: The countries ISO alpha-2 code.

bool $clear_cache: A flag to prevent cache flushes.

Return value

mixed There is no standard result from this callback. However, FALSE would almost certainly indicate a failure.

3 calls to country_delete()
CountriesCacheUnitTest::testCache in tests/countries.test
CountriesCRUDUnitTest::testCountriesCRUD in tests/countries.test
This test that the country property lookup is working.
countries_admin_delete_submit in ./countries.admin.inc
Process countries delete form submission.

File

./countries.module, line 413
Defines the field and entity information for countries.

Code

function country_delete($iso2, $clear_cache = TRUE) {
  $iso2 = drupal_strtoupper($iso2);
  $result = entity_delete('country', $iso2);
  if ($clear_cache) {
    countries_clear_caches();
  }
  return $result;
}