Prepares an instance definition for the current run-time context.
$instance: The raw instance structure as read from the database.
$field_type: The field type.
The field instance array completed for the current runtime context.
public function prepareInstance($instance, $field_type) {
// Make sure all expected instance settings are present.
$instance['settings'] += field_info_instance_settings($field_type);
// Set a default value for the instance.
if (field_behaviors_widget('default value', $instance) == FIELD_BEHAVIOR_DEFAULT && !isset($instance['default_value'])) {
$instance['default_value'] = NULL;
}
return $instance;
}