You are here

function farm_plan_entity_property_info_alter in farmOS 7

Implements hook_entity_property_info_alter().

File

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

Code

function farm_plan_entity_property_info_alter(&$info) {
  $properties =& $info['farm_plan']['properties'];
  $properties['name'] = array(
    'label' => t('Name'),
    'description' => t('The name of the plan.'),
    'setter callback' => 'entity_property_verbatim_set',
    'schema field' => 'name',
  );
  $properties['type'] = array(
    'label' => t('Farm plan type'),
    'type' => 'token',
    'description' => t('The farm plan type.'),
    'setter callback' => 'entity_property_verbatim_set',
    'access callback' => 'farm_plan_properties_access',
    'options list' => 'farm_plan_type_get_names',
    'required' => TRUE,
    'schema field' => 'type',
  );
  $properties['uid'] = array(
    'label' => t('Owner'),
    'type' => 'user',
    'description' => t('The owner of the plan.'),
    'setter callback' => 'entity_property_verbatim_set',
    'access callback' => 'farm_plan_properties_access',
    'required' => TRUE,
    'schema field' => 'uid',
  );
  $properties['created'] = array(
    'label' => t('Created'),
    'type' => 'date',
    'description' => t('The timestamp when the plan was created.'),
    'setter callback' => 'entity_property_verbatim_set',
    'access callback' => 'farm_plan_properties_access',
    'required' => TRUE,
    'schema field' => 'created',
  );
  $properties['changed'] = array(
    'label' => t('Changed'),
    'type' => 'date',
    'description' => t('The timestamp when the plan was last modified.'),
    'setter callback' => 'entity_property_verbatim_set',
    'access callback' => 'farm_plan_properties_access',
    'required' => TRUE,
    'schema field' => 'changed',
  );
  $properties['active'] = array(
    'label' => t('Active'),
    'description' => t('Whether the plan is active.'),
    'setter callback' => 'entity_property_verbatim_set',
    'access callback' => 'farm_plan_properties_access',
    'schema field' => 'active',
    'type' => 'boolean',
  );
}