You are here

function field_nif_field_schema in Field NIF 7

Implements hook_field_schema().

File

./field_nif.install, line 10

Code

function field_nif_field_schema($field) {
  if ($field['type'] == 'nif') {
    return array(
      'columns' => array(
        'number' => array(
          'description' => 'Numeric part of the NIF',
          'type' => 'varchar',
          'length' => 8,
        ),
        'first_letter' => array(
          'description' => 'First letter of the NIF/CIF/NIE',
          'type' => 'varchar',
          'length' => 1,
        ),
        'last_letter' => array(
          'description' => 'Last letter of the NIF/CIF/NIE',
          'type' => 'varchar',
          'length' => 1,
        ),
        'type' => array(
          'description' => 'Type of the number, NIF/CIF/NIE',
          'type' => 'varchar',
          'length' => 10,
        ),
      ),
      'indexes' => array(),
    );
  }
}