You are here

function countries_configuration_country_update in Countries 8

Same name and namespace in other branches
  1. 7.2 modules/countries_configuration/countries_configuration.module \countries_configuration_country_update()

Implements hook_country_update().

This tracks iso2 changes for maintaining the {countries_data} table.

File

modules/countries_configuration/countries_configuration.module, line 112
Provides the base framework for integration for storing country specific data on behalf of other modules.

Code

function countries_configuration_country_update($country) {
  if (isset($country->original->iso2) && $country->original->iso2 != $country->iso2) {
    db_update('countries_data')
      ->fields(array(
      'iso2' => $country->iso2,
    ))
      ->condition('iso2', $country->original->iso2)
      ->execute();
  }
}