You are here

function merci_line_item_entity_property_info_alter in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Implements hook_entity_property_info().

File

merci_line_item/merci_line_item.module, line 162
Defines the core MERCI line item entity and API functions interact with line items.

Code

function merci_line_item_entity_property_info_alter(&$info) {
  $properties =& $info['merci_line_item']['properties'];
  $properties['entity'] = array(
    'label' => t('Entity', array(), array(
      'context' => 'a drupal entity',
    )),
    'type' => 'entity',
    'description' => t('The entity the line item belongs to.'),
    'getter callback' => 'merci_line_item_get_properties',
    'setter callback' => 'merci_line_item_set_properties',
    'setter permission' => 'administer merci line items',
    'required' => TRUE,
    'computed' => TRUE,
    'clear' => array(
      'entity_id',
    ),
  );
  $properties['created'] = array(
    'label' => t('Date created'),
    'description' => t('The date the line item was created.'),
    'type' => 'date',
    'setter callback' => 'entity_metadata_verbatim_set',
    'setter permission' => 'administer merci line items',
    'schema field' => 'created',
  );
  $properties['changed'] = array(
    'label' => t('Date changed'),
    'description' => t('The date the line item was most recently updated.'),
    'type' => 'date',
    'schema field' => 'changed',
  );
  $properties['line_item_label'] = array(
    'label' => t('Line item label'),
    'description' => t('The label displayed with the line item.'),
    'type' => 'text',
    'setter callback' => 'entity_property_verbatim_set',
    'required' => TRUE,
    'schema field' => 'line_item_label',
  );
  $properties['owner'] = array(
    'label' => t('Owner'),
    'description' => t('The owner of the reservation.'),
    'type' => 'user',
    'schema field' => 'uid',
  );
}