function farm_asset_entity_property_info_alter in farmOS 7
Implements hook_entity_property_info_alter().
File
- modules/
farm/ farm_asset/ farm_asset.module, line 238 - Farm asset - A farm asset entity type.
Code
function farm_asset_entity_property_info_alter(&$info) {
$properties =& $info['farm_asset']['properties'];
$properties['name'] = array(
'label' => t('Name'),
'description' => t('The name of the asset.'),
'setter callback' => 'entity_property_verbatim_set',
'schema field' => 'name',
);
$properties['type'] = array(
'label' => t('Farm asset type'),
'type' => 'token',
'description' => t('The farm asset type.'),
'setter callback' => 'entity_property_verbatim_set',
'access callback' => 'farm_asset_properties_access',
'options list' => 'farm_asset_type_get_names',
'required' => TRUE,
'schema field' => 'type',
);
$properties['uid'] = array(
'label' => t('Author'),
'type' => 'user',
'description' => t('The author of the asset.'),
'setter callback' => 'entity_property_verbatim_set',
'access callback' => 'farm_asset_properties_access',
'required' => TRUE,
'schema field' => 'uid',
);
$properties['created'] = array(
'label' => t('Created'),
'type' => 'date',
'description' => t('The timestamp when the asset was created.'),
'setter callback' => 'entity_property_verbatim_set',
'access callback' => 'farm_asset_properties_access',
'required' => TRUE,
'schema field' => 'created',
);
$properties['changed'] = array(
'label' => t('Changed'),
'type' => 'date',
'description' => t('The timestamp when the asset was last modified.'),
'setter callback' => 'entity_property_verbatim_set',
'access callback' => 'farm_asset_properties_access',
'required' => TRUE,
'schema field' => 'changed',
);
$properties['archived'] = array(
'label' => t('Archived'),
'type' => 'date',
'description' => t('The timestamp when the asset was archived.'),
'setter callback' => 'entity_property_verbatim_set',
'access callback' => 'farm_asset_properties_access',
'schema field' => 'archived',
);
}