You are here

function _computed_field_compute_value in Computed Field 6

Same name and namespace in other branches
  1. 5 computed_field.module \_computed_field_compute_value()
  2. 7 computed_field.module \_computed_field_compute_value()
1 call to _computed_field_compute_value()
computed_field_field in ./computed_field.module
Implementation of cck hook_field()

File

./computed_field.module, line 215

Code

function _computed_field_compute_value(&$node, $field, &$node_field) {

  // Allow the value to be computed from code not stored in DB
  $compute_func = 'computed_field_' . $field['field_name'] . '_compute';
  if (function_exists($compute_func)) {
    $compute_func($node, $field, $node_field);
  }
  else {
    if (isset($field['code'])) {
      eval($field['code']);
    }
  }
}