You are here

function country_save in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.module \country_save()
  2. 7 countries.module \country_save()

Saves a country.

Parameters

object $country: The country object to save.

bool $clear_cache: A flag to prevent cache flushes.

Return value

int SAVED_NEW or SAVED_UPDATED is returned depending on the operation.

9 calls to country_save()
CountriesCacheUnitTest::testCache in tests/countries.test
CountriesCRUDUnitTest::testCountriesCRUD in tests/countries.test
This test that the country property lookup is working.
CountriesElementUnitTest::setUp in tests/countries.test
CountriesElementUnitTest::testFAPIElement in tests/countries.test
CountriesFunctionsUnitTest::testCountriesLock in tests/countries.test
This test that core countries can not be deleted while user ones are.

... See full list

File

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

Code

function country_save(&$country, $clear_cache = TRUE) {
  $result = entity_save('country', $country);
  if ($clear_cache) {
    countries_clear_caches();
  }
  return $result;
}