You are here

function migrate_example_wine_fields in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 migrate_example/wine.install.inc \migrate_example_wine_fields()
1 call to migrate_example_wine_fields()
migrate_example_wine_install in migrate_example/wine.install.inc

File

migrate_example/wine.install.inc, line 708
Set up for the wine (advanced) example.

Code

function migrate_example_wine_fields() {
  $field = array(
    'field_name' => 'field_migrate_example_wine_ratin',
    'type' => 'number_decimal',
    'widget_type' => 'number',
    'type_name' => 'migrate_example_wine',
    'label' => t('Rating'),
    'scale' => 0,
  );
  content_field_instance_create($field);
  $field = array(
    'field_name' => 'field_migrate_example_wine_rvw',
    'type' => 'datestamp',
    'type_name' => 'migrate_example_wine',
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      '4' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
    'widget_active' => '1',
    'required' => '0',
    'multiple' => '0',
    'module' => 'date',
    'active' => '1',
    'granularity' => array(
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
      'hour' => 'hour',
      'minute' => 'minute',
    ),
    'timezone_db' => 'UTC',
    'tz_handling' => 'site',
    'todate' => '',
    'repeat' => 0,
    'repeat_collapsed' => '',
    'default_format' => 'medium',
    'widget' => array(
      'default_value' => 'blank',
      'default_value_code' => '',
      'default_value2' => 'same',
      'default_value_code2' => '',
      'input_format' => 'M j Y',
      'input_format_custom' => '',
      'increment' => '15',
      'text_parts' => array(),
      'year_range' => '-3:+3',
      'label_position' => 'above',
      'label' => 'Last Reviewed',
      'weight' => '10',
      'description' => '',
      'type' => 'date_text',
      'module' => 'date',
    ),
  );
  content_field_instance_create($field);
  $field = array(
    'label' => 'Recommended vintages',
    'field_name' => 'field_migrate_example_top_vintag',
    'type' => 'number_integer',
    'type_name' => 'migrate_example_wine',
    'widget_type' => 'number',
    'change' => 'Change basic information',
    'weight' => '31',
    'description' => '',
    'default_value' => array(
      0 => array(
        'value' => '',
        '_error_element' => 'default_value_widget][field_migrate_example_top_vintag][0][value',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' => NULL,
    'group' => false,
    'required' => 0,
    'multiple' => '1',
    'min' => '1472',
    'max' => '2010',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'number',
    'widget_module' => 'number',
    'columns' => array(
      'value' => array(
        'type' => 'int',
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' => array(
      'label' => array(
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => array(
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => array(
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  );
  content_field_instance_create($field);
  migrate_example_wine_image();
}