You are here

function units_field_field_presave in Units of Measurement 7.2

Implements hook_field_presave().

File

units_field/units_field.module, line 134
Provide field type for storing measured values.

Code

function units_field_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  foreach ($items as &$item) {
    $item['expression']
      ->save();
    $item['mathematical_expression_id'] = $item['expression']
      ->getMathematicalExpressionId();
  }
}