You are here

function countries_entity_info in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.module \countries_entity_info()
  2. 7 countries.module \countries_entity_info()

Implements hook_entity_info().

File

./countries.module, line 175
Defines the field and entity information for countries.

Code

function countries_entity_info() {
  $return = array(
    'country' => array(
      'label' => t('Country'),
      'entity class' => 'Entity',
      'controller class' => 'EntityAPIControllerExportable',
      'base table' => 'countries_country',
      'fieldable' => TRUE,
      'module' => 'countries',
      'entity keys' => array(
        'id' => 'cid',
        'name' => 'iso2',
        'label' => 'name',
      ),
      'bundles' => array(
        'country' => array(
          'label' => t('Country'),
          'admin' => array(
            'path' => 'admin/config/regional/countries',
            'access arguments' => array(
              'administer site configuration',
            ),
          ),
        ),
      ),
      'view modes' => array(
        'full' => array(
          'label' => t('Country'),
          'custom settings' => FALSE,
        ),
      ),
      'translation' => array(
        'entity_translation' => array(
          'base path' => 'admin/config/regional/countries/%country',
        ),
      ),
    ),
  );
  return $return;
}