You are here

function commerce_uuid_entity_uuid_load in Commerce UUID 7

Implements hook_entity_uuid_load().

File

./commerce_uuid.module, line 45
Adds universally unique identifiers support to Drupal Commerce.

Code

function commerce_uuid_entity_uuid_load(&$entities, $entity_type) {
  if ($entity_type == 'commerce_customer_profile') {
    entity_property_id_to_uuid($entities, 'user', 'uid');
  }
  if ($entity_type == 'commerce_line_item') {
    entity_property_id_to_uuid($entities, 'commerce_order', array(
      'order_id',
    ));
  }
  if ($entity_type == 'commerce_order') {
    entity_property_id_to_uuid($entities, 'user', array(
      'uid',
      'revision_uid',
    ));
  }
  if ($entity_type == 'commerce_payment_transaction') {
    entity_property_id_to_uuid($entities, 'user', 'uid');
    entity_property_id_to_uuid($entities, 'commerce_order', 'order_id');
  }
  if ($entity_type == 'commerce_product') {
    entity_property_id_to_uuid($entities, 'user', 'uid');
  }
}