You are here

function _date_repeat_entity_create_base_fields in Date Repeat Entity 7.2

Creates base fields.

This function used during module installation or when field instances are being created for bundles and the base fields do not exist for some particular reason.

2 calls to _date_repeat_entity_create_base_fields()
date_repeat_entity_admin_settings_submit in ./date_repeat_entity.admin.inc
Submit handler for configuration form.
date_repeat_entity_install in ./date_repeat_entity.install
Implements hook_install().

File

./date_repeat_entity.module, line 518
Adds functionality to entities with repeating date fields

Code

function _date_repeat_entity_create_base_fields() {

  // Create base fields, specific to this module.
  if (!field_info_field(DATE_REPEAT_ENTITY_FIELD_MASTER_UUID)) {
    $definition_master_uuid = array(
      'field_name' => DATE_REPEAT_ENTITY_FIELD_MASTER_UUID,
      'type' => 'text',
      'locked' => TRUE,
      'cardinality' => 1,
    );
    field_create_field($definition_master_uuid);
  }
  if (!field_info_field(DATE_REPEAT_ENTITY_FIELD_CLONE_STATE)) {
    $definition_clone_state = array(
      'field_name' => DATE_REPEAT_ENTITY_FIELD_CLONE_STATE,
      'type' => 'list_boolean',
      'locked' => TRUE,
      'cardinality' => 1,
      'deleted' => 0,
      'entity_types' => array(),
      'foreign keys' => array(),
      'indexes' => array(
        'value' => array(
          0 => 'value',
        ),
      ),
      'module' => 'list',
      'settings' => array(
        'allowed_values' => array(
          0 => '',
          1 => '',
        ),
        'allowed_values_function' => '',
      ),
      'translatable' => 0,
    );
    field_create_field($definition_clone_state);
  }
}