function farm_asset_entity_info in farmOS 7
Implements hook_entity_info().
File
- modules/
farm/ farm_asset/ farm_asset.module, line 163 - Farm asset - A farm asset entity type.
Code
function farm_asset_entity_info() {
$return = array(
'farm_asset' => array(
'label' => t('Farm asset'),
'entity class' => 'FarmAsset',
'controller class' => 'FarmAssetController',
'base table' => 'farm_asset',
'fieldable' => TRUE,
'entity keys' => array(
'id' => 'id',
'bundle' => 'type',
'label' => 'name',
),
'bundle keys' => array(
'bundle' => 'type',
),
'bundles' => array(),
'load hook' => 'farm_asset_load',
'view modes' => array(
'full' => array(
'label' => t('Default'),
'custom settings' => FALSE,
),
),
'label callback' => 'entity_class_label',
'uri callback' => 'entity_class_uri',
'module' => 'farm_asset',
'access callback' => 'farm_asset_access',
),
);
$return['farm_asset_type'] = array(
'label' => t('Farm asset type'),
'entity class' => 'FarmAssetType',
'controller class' => 'FarmAssetTypeController',
'base table' => 'farm_asset_type',
'fieldable' => FALSE,
'bundle of' => 'farm_asset',
'exportable' => TRUE,
'entity keys' => array(
'id' => 'id',
'name' => 'type',
'label' => 'label',
),
'module' => 'farm_asset',
// Enable the entity API admin UI.
'admin ui' => array(
'path' => 'admin/config/farm/asset-types',
'file' => 'farm_asset.admin.inc',
'controller class' => 'FarmAssetTypeUIController',
),
'access callback' => 'farm_asset_type_access',
);
return $return;
}