You are here

function restful_test_entity_info in RESTful 7

Same name and namespace in other branches
  1. 7.2 tests/modules/restful_test/restful_test.module \restful_test_entity_info()

Implements hook_entity_info().

File

tests/modules/restful_test/restful_test.module, line 440
Helper module for testing the RESTful module.

Code

function restful_test_entity_info() {
  return array(
    'restful_test_translatable_entity' => array(
      'label' => t('Translatable Test Entity'),
      'plural label' => t('Translatable Test Entities'),
      'description' => t('An entity type used by the Restful tests.'),
      'entity class' => 'Entity',
      'controller class' => 'EntityAPIController',
      'base table' => 'restful_test_translatable_entity',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'pid',
        'bundle' => 'name',
        'label' => 'label',
      ),
      // Make use the class' label() and uri() implementation by default.
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      'bundles' => array(
        'restful_test_translatable_entity' => array(
          'label' => 'Translatable Test Entity',
        ),
      ),
      'bundle keys' => array(
        'bundle' => 'name',
      ),
      'module' => 'restful_test',
      'translation' => array(
        'locale' => TRUE,
      ),
    ),
  );
}