You are here

function farm_plan_entity_info in farmOS 7

Implements hook_entity_info().

File

modules/farm/farm_plan/farm_plan.module, line 167
Farm plan - A farm plan entity type.

Code

function farm_plan_entity_info() {
  $return = array(
    'farm_plan' => array(
      'label' => t('Farm plan'),
      'entity class' => 'FarmPlan',
      'controller class' => 'FarmPlanController',
      'base table' => 'farm_plan',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'id',
        'bundle' => 'type',
        'label' => 'name',
      ),
      'bundle keys' => array(
        'bundle' => 'type',
      ),
      'bundles' => array(),
      'load hook' => 'farm_plan_load',
      'view modes' => array(
        'full' => array(
          'label' => t('Default'),
          'custom settings' => FALSE,
        ),
      ),
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      'module' => 'farm_plan',
      'access callback' => 'farm_plan_access',
    ),
  );
  $return['farm_plan_type'] = array(
    'label' => t('Farm plan type'),
    'entity class' => 'FarmPlanType',
    'controller class' => 'FarmPlanTypeController',
    'base table' => 'farm_plan_type',
    'fieldable' => FALSE,
    'bundle of' => 'farm_plan',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'type',
      'label' => 'label',
    ),
    'module' => 'farm_plan',
    // Enable the entity API admin UI.
    'admin ui' => array(
      'path' => 'admin/config/farm/plan-types',
      'file' => 'farm_plan.admin.inc',
      'controller class' => 'FarmPlanTypeUIController',
    ),
    'access callback' => 'farm_plan_type_access',
  );
  return $return;
}