You are here

function units_units_measure_update in Units of Measurement 7.2

Same name and namespace in other branches
  1. 7 units.module \units_units_measure_update()

Implements hook_ENTITY_TYPE_update().

File

./units.module, line 242
Provide API for managing and converting units of measurement.

Code

function units_units_measure_update($entity) {
  if ($entity->measure != $entity->original->measure) {
    db_update('units_unit')
      ->condition('measure', $entity->original->measure)
      ->fields(array(
      'measure' => $entity->measure,
    ))
      ->execute();
  }
}