references_uuid.module 919 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * This provides UUID support for node and user references
  5. */
  6. /**
  7. * Implements hook_field_uuid_load().
  8. */
  9. function node_reference_field_uuid_load($entity_type, $entity, $field, $instance, $langcode, &$items) {
  10. entity_property_id_to_uuid($items, 'node', 'nid');
  11. }
  12. /**
  13. * Implements hook_field_uuid_presave().
  14. */
  15. function node_reference_field_uuid_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  16. entity_property_uuid_to_id($items, 'node', 'nid');
  17. }
  18. /**
  19. * Implements hook_field_uuid_load().
  20. */
  21. function user_reference_field_uuid_load($entity_type, $entity, $field, $instance, $langcode, &$items) {
  22. entity_property_id_to_uuid($items, 'user', 'uid');
  23. }
  24. /**
  25. * Implements hook_field_uuid_presave().
  26. */
  27. function user_reference_field_uuid_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  28. entity_property_uuid_to_id($items, 'user', 'uid');
  29. }