function mvf_field_instance in Measured Value Field 7
Supportive function.
Sometimes it's necessary for MVF to pull up any instance of a specific field. This function loads and returns first found instance of the supplied field definition array
Parameters
array $field: Field definition array
Return value
array Instance definition array of the first found instance of the supplied field
2 calls to mvf_field_instance()
- mvf_field_widget_validate_value_form_state_mockup_override in ./
mvf.module - FAPI element validate function.
- mvf_handler_filter_mvf::value_form in views/
mvf_handler_filter_mvf.inc - Provide a simple textfield for equality
File
- ./
mvf.module, line 1939 - Define a field type of measured value.
Code
function mvf_field_instance($field) {
$entity_type = array_keys($field['bundles']);
$entity_type = array_pop($entity_type);
$instance = field_info_instance($entity_type, $field['field_name'], $field['bundles'][$entity_type][0]);
return $instance;
}