field_test_entity_info()Implements hook_entity_info().
modules/field/tests/field_test.entity.inc, line 11
<?php
function field_test_entity_info() {
$bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
$test_entity_modes = array(
'full' => array(
'label' => t('Full object'),
),
'teaser' => array(
'label' => t('Teaser'),
),
);
return array(
'test_entity' => array(
'name' => t('Test Entity'),
'object keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'cacheable' => FALSE,
'bundles' => $bundles,
'fieldable' => TRUE,
'view modes' => $test_entity_modes,
),
// This entity type doesn't get form handling for now...
'test_cacheable_entity' => array(
'name' => t('Test Entity, cacheable'),
'object keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'fieldable' => TRUE,
'cacheable' => TRUE,
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
);
}
?>