You are here

function units_units_unit_load in Units of Measurement 7.2

Implements hook_ENTITY_TYPE_load().

File

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

Code

function units_units_unit_load($entities) {

  // TODO: it should be replace with a batch loading all involved mathematical
  // expressions in a single SQL SELECT.
  foreach ($entities as $entity) {
    $entity->decomposition = $entity->decomposition_mathematical_expression_id ? units_mathematical_expression_load($entity->decomposition_mathematical_expression_id) : NULL;
  }
}