You are here

function _crm_core_relationship_field_status_instance in CRM Core 8

Same name and namespace in other branches
  1. 8.3 modules/crm_core_relationship/crm_core_relationship.fields.inc \_crm_core_relationship_field_status_instance()
  2. 8.2 modules/crm_core_relationship/crm_core_relationship.fields.inc \_crm_core_relationship_field_status_instance()
  3. 7 modules/crm_core_relationship/crm_core_relationship.fields.inc \_crm_core_relationship_field_status_instance()

Relationship field status instance.

Parameters

string $type: Bundle type.

Return value

array Array of field instances config.

1 call to _crm_core_relationship_field_status_instance()
crm_core_relationship_field_attach_create_bundle in modules/crm_core_relationship/crm_core_relationship.module
Implements hook_field_attach_create_bundle.

File

modules/crm_core_relationship/crm_core_relationship.fields.inc, line 59
CRM Core Relationships fields.

Code

function _crm_core_relationship_field_status_instance($type) {
  $fields = [];
  $fields[] = [
    'bundle' => $type,
    'default_value' => [
      0 => [
        'value' => 1,
      ],
    ],
    'deleted' => '0',
    'description' => '',
    'display' => [
      'default' => [
        'label' => 'above',
        'module' => 'list',
        'settings' => [],
        'type' => 'list_default',
        'weight' => 1,
      ],
    ],
    'entity_type' => 'relation',
    'field_name' => 'crm_core_relationship_status',
    'label' => t('Status'),
    'required' => 0,
    'settings' => [
      'user_register_form' => FALSE,
    ],
    'widget' => [
      'active' => 1,
      'module' => 'options',
      'settings' => [
        'display_label' => 0,
      ],
      'type' => 'options_onoff',
      'weight' => '1',
    ],
  ];
  return $fields;
}