You are here

function double_field_field_info in Double Field 7.2

Same name and namespace in other branches
  1. 7 double_field.module \double_field_field_info()

Implements hook_field_info().

File

./double_field.module, line 73
Defines "Double field" field type.

Code

function double_field_field_info() {
  foreach (array(
    'first',
    'second',
  ) as $subfield) {
    $settings[$subfield] = array(
      'type' => 'varchar',
      'maxlength' => 255,
      'size' => 'normal',
      'precision' => 10,
      'scale' => 2,
    );
  }
  return array(
    'double_field' => array(
      'label' => t('Double field'),
      'description' => t('Double text field'),
      'default_widget' => 'double_field',
      'default_formatter' => 'double_field_unformatted_list',
      'settings' => $settings,
      // Integrate with the Entity Metadata module.
      'property_type' => 'double_field',
      'property_callbacks' => array(
        'double_field_property_callback',
      ),
    ),
  );
}