1 entity_test.install | entity_test_install() |
Implements hook_install().
File
- core/
modules/ entity/ tests/ entity_test/ entity_test.install, line 10 - Install, update and uninstall functions for the entity_test module.
Code
function entity_test_install() {
// Auto-create a field for testing.
$field = array(
'field_name' => 'field_test_text',
'type' => 'text',
'cardinality' => 1,
'translatable' => FALSE,
);
field_create_field($field);
$instance = array(
'entity_type' => 'entity_test',
'field_name' => 'field_test_text',
'bundle' => 'entity_test',
'label' => 'Test text-field',
'widget' => array(
'type' => 'text_textfield',
'weight' => 0,
),
);
field_create_instance($instance);
}