You are here

function country_is_locked in Countries 8

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

The module locks a country record if it is defined internally by Drupal.

Parameters

object $country: The country object.

Return value

bool TRUE if the country is not deletable.

6 calls to country_is_locked()
CountriesBaseSetupTest::assertCountryListed in tests/countries.test
CountriesFunctionsUnitTest::testCountriesLock in tests/countries.test
This test that core countries can not be deleted while user ones are.
countries_admin_delete in ./countries.admin.inc
Menu callback; confirm deletion of a country.
countries_admin_form in ./countries.admin.inc
Generate a country form.
countries_admin_overview in ./countries.admin.inc
Menu callback; Displays a list of all countries.

... See full list

File

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

Code

function country_is_locked($country) {
  include_once DRUPAL_ROOT . '/includes/iso.inc';
  $countries = _country_get_predefined_list();
  return !empty($country->iso2) && array_key_exists($country->iso2, $countries);
}