uc_cart.info.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @file
  4. * Entity metadata hooks for uc_cart.module.
  5. */
  6. /**
  7. * Implements hook_entity_property_info().
  8. */
  9. function uc_cart_entity_property_info() {
  10. $info = array();
  11. $properties = &$info['uc_cart_item']['properties'];
  12. $properties['cart_item_id'] = array(
  13. 'type' => 'integer',
  14. 'label' => t('Cart item ID'),
  15. 'description' => t('The unique ID of the cart item.'),
  16. 'validation callback' => 'entity_metadata_validate_integer_positive',
  17. 'schema field' => 'cart_item_id',
  18. );
  19. $properties['cart_id'] = array(
  20. 'type' => 'text',
  21. 'label' => t('Cart ID'),
  22. 'description' => t('The user ID or anonymous hash ID of the cart.'),
  23. 'schema field' => 'cart_id',
  24. );
  25. $properties['nid'] = array(
  26. 'type' => 'integer',
  27. 'label' => t('Node ID'),
  28. 'description' => t('The node ID of the cart item.'),
  29. 'validation callback' => 'entity_metadata_validate_integer_positive',
  30. 'schema field' => 'nid',
  31. );
  32. $properties['qty'] = array(
  33. 'type' => 'integer',
  34. 'label' => t('Quantity'),
  35. 'description' => t('The number of this product in the cart.'),
  36. 'setter callback' => 'entity_property_verbatim_set',
  37. 'schema field' => 'qty',
  38. );
  39. $properties['changed'] = array(
  40. 'type' => 'date',
  41. 'label' => t('Changed'),
  42. 'description' => t('The time that the product was last changed.'),
  43. 'schema field' => 'changed',
  44. );
  45. $properties['node'] = array(
  46. 'type' => 'node',
  47. 'label' => t('Node'),
  48. 'description' => t('The node representing the product.'),
  49. 'getter callback' => 'uc_order_product_node_property_get',
  50. );
  51. return $info;
  52. }