uuid.api.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the UUID module.
  5. */
  6. /**
  7. * Defines one or more UUID generators exposed by a module.
  8. *
  9. * @return
  10. * An associative array with the key being the machine name for the
  11. * implementation and the values being an array with the following keys:
  12. * - title: The human readable name for the generator.
  13. * - callback: The function to be called for generating the UUID.
  14. *
  15. * @see uuid_get_info()
  16. */
  17. function hook_uuid_info() {
  18. $generators = array();
  19. $generators['my_module'] = array(
  20. 'title' => t('My module UUID generator'),
  21. 'callback' => 'my_module_generate_uuid',
  22. );
  23. return $generators;
  24. }
  25. /**
  26. * Ensures all records have a UUID assigned to them.
  27. *
  28. * When called this hook should ensure all records it is responsible for
  29. * have a UUID and if not create one.
  30. *
  31. * @see entity_uuid_sync()
  32. */
  33. function hook_uuid_sync() {
  34. // Do what you need to do to generate missing UUIDs for you implementation.
  35. }
  36. /**
  37. * Let modules transform their properties with local IDs to UUIDs when an
  38. * entity is loaded.
  39. */
  40. function hook_entity_uuid_load(&$entities, $entity_type) {
  41. }
  42. /**
  43. * Let modules transform their fields with local IDs to UUIDs when an entity
  44. * is loaded.
  45. */
  46. function hook_field_uuid_load($entity_type, $entity, $field, $instance, $langcode, &$items) {
  47. }
  48. /**
  49. * Let modules transform their properties with UUIDs to local IDs when an
  50. * entity is saved.
  51. */
  52. function hook_entity_uuid_presave(&$entity, $entity_type) {
  53. }
  54. /**
  55. * Let modules transform their fields with UUIDs to local IDs when an entity
  56. * is saved.
  57. */
  58. function hook_field_uuid_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  59. }
  60. /**
  61. * Let modules transform their properties when an entity is saved.
  62. */
  63. function hook_entity_uuid_save($entity, $entity_type) {
  64. }
  65. /**
  66. * Let modules act when an entity is deleted.
  67. */
  68. function hook_entity_uuid_delete($entity, $entity_type) {
  69. }
  70. /**
  71. * Let modules modify paths when they are being converted to UUID ones.
  72. */
  73. function hook_uuid_menu_path_to_uri_alter($path, &$uri) {
  74. }
  75. /**
  76. * Let modules modify paths when they are being converted from UUID ones.
  77. */
  78. function hook_uuid_menu_uri_to_path(&$path, $uri) {
  79. }
  80. /**
  81. * Allow modules to provide a list of default entities that will be imported.
  82. */
  83. function hook_uuid_default_entities() {
  84. }
  85. /**
  86. * Let other modules do things before default entities are created on rebuild.
  87. */
  88. function hook_uuid_entities_pre_rebuild($plan_name) {
  89. }
  90. /**
  91. * Let other modules do things after default entities are created on rebuild.
  92. */
  93. function hook_uuid_entities_post_rebuild($plan_name) {
  94. }
  95. /**
  96. * Let other modules do things before default entities are created on revert.
  97. */
  98. function hook_uuid_entities_pre_revert($plan_name) {
  99. }
  100. /**
  101. * Let other modules do things after default entities are created on revert.
  102. */
  103. function hook_uuid_entities_post_revert($plan_name) {
  104. }
  105. /**
  106. * Let other modules alter entities that are about to be exported.
  107. */
  108. function hook_uuid_entities_features_export_entity_alter(&$entity, $entity_type) {
  109. }
  110. /**
  111. * Let other modules alter fields on entities that are about to be exported.
  112. */
  113. function hook_uuid_entities_features_export_field_alter($entity_type, &$entity, $field, $instance, $langcode, &$items) {
  114. }
  115. /**
  116. * Alter UUID URI data after processing.
  117. */
  118. function hook_uuid_uri_data($data) {
  119. }
  120. /**
  121. * Alter entity URI before creating UUID URI.
  122. */
  123. function hook_uuid_id_uri_data($data) {
  124. }