You are here

function units_field_field_load in Units of Measurement 7.2

Implements hook_field_load().

File

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

Code

function units_field_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {

  // TODO: this should be replaced with a batch load in a single SQL SELECT.
  foreach ($entities as $id => $entity) {
    foreach ($items[$id] as $delta => $item) {
      $items[$id][$delta]['expression'] = units_mathematical_expression_load($item['mathematical_expression_id']);
    }
  }
}