You are here

function services_entity_test_install in Services Entity API 7.2

Implements hook_install().

File

tests/services_entity_test/services_entity_test.install, line 56
services_entity_test.install Contains install hooks.

Code

function services_entity_test_install() {

  // Add FieldAPI fields to our test entity type.
  $field = array(
    'field_name' => 'field_test_text_alpha',
    'cardinality' => 1,
    'type' => 'text',
    'settings' => array(
      'max_length' => 60,
    ),
  );
  field_create_field($field);
  $instance = array(
    'field_name' => 'field_test_text_alpha',
    'entity_type' => 'services_entity_test',
    'bundle' => 'alpha',
    'label' => 'Label',
    'widget' => array(
      'type' => 'text_textfield',
    ),
    'display' => array(
      'default' => array(
        'label' => 'hidden',
        'type' => 'text_default',
      ),
    ),
  );
  field_create_instance($instance);
}