function asset_entity_property_info_alter in Asset 7
Implements hook_entity_property_info_alter(). @todo: Why we are using alter instead of hook_entity_property_info() like Entity module originally does?
File
- ./
asset.module, line 880 - Asset module.
Code
function asset_entity_property_info_alter(&$info) {
$properties =& $info['asset']['properties'];
$properties['uid'] = array(
'label' => t('Author'),
'type' => 'user',
'description' => t('The author of the asset.'),
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer assets',
'required' => TRUE,
'schema field' => 'uid',
);
$properties['type'] = array(
'label' => t('Asset type'),
'description' => t('The type of the asset.'),
'setter callback' => 'entity_property_verbatim_set',
'type' => 'asset_type',
'required' => TRUE,
'schema field' => 'type',
'options list' => 'asset_type_get_names',
);
$properties['title'] = array(
'label' => t('Label'),
'description' => t('The human readable label.'),
'setter callback' => 'entity_property_verbatim_set',
'type' => 'text',
'schema field' => 'title',
'required' => TRUE,
);
$properties['created'] = array(
'label' => t('Date created'),
'type' => 'date',
'description' => t('The date the asset was created.'),
'setter callback' => 'entity_property_verbatim_set',
'setter permission' => 'administer assets',
'schema field' => 'created',
);
$properties['changed'] = array(
'label' => t('Date changed'),
'type' => 'date',
'schema field' => 'changed',
'description' => t('The date the asset was most recently updated.'),
);
$properties =& $info['asset_type']['properties'];
$properties['id'] = array(
'label' => t('Asset type ID'),
'description' => t('The unique ID of the asset type.'),
'type' => 'integer',
'schema field' => 'id',
);
$properties['name'] = array(
'label' => t('Name'),
'description' => t('The name of the asset type.'),
'setter callback' => 'entity_property_verbatim_set',
'required' => TRUE,
'schema field' => 'name',
);
$properties['machine_name'] = array(
'label' => t('Machine name'),
'type' => 'token',
'description' => t('The machine name of the asset type.'),
'setter callback' => 'entity_property_verbatim_set',
'required' => TRUE,
'schema field' => 'type',
);
$properties['description'] = array(
'label' => t('Description'),
'description' => t('The optional description of the asset type.'),
'setter callback' => 'entity_property_verbatim_set',
'sanitize' => 'filter_xss',
'schema field' => 'description',
);
return $info;
}