path.api.php

Hooks provided by the Path module.

File

drupal/modules/path/path.api.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the Path module.
  5. */
  6. /**
  7. * @addtogroup hooks
  8. * @{
  9. */
  10. /**
  11. * Respond to a path being inserted.
  12. *
  13. * @param $path
  14. * An associative array containing the following keys:
  15. * - source: The internal system path.
  16. * - alias: The URL alias.
  17. * - pid: Unique path alias identifier.
  18. * - language: The language of the alias.
  19. *
  20. * @see path_save()
  21. */
  22. function hook_path_insert($path) {
  23. db_insert('mytable')
  24. ->fields(array(
  25. 'alias' => $path['alias'],
  26. 'pid' => $path['pid'],
  27. ))
  28. ->execute();
  29. }
  30. /**
  31. * Respond to a path being updated.
  32. *
  33. * @param $path
  34. * An associative array containing the following keys:
  35. * - source: The internal system path.
  36. * - alias: The URL alias.
  37. * - pid: Unique path alias identifier.
  38. * - language: The language of the alias.
  39. *
  40. * @see path_save()
  41. */
  42. function hook_path_update($path) {
  43. db_update('mytable')
  44. ->fields(array('alias' => $path['alias']))
  45. ->condition('pid', $path['pid'])
  46. ->execute();
  47. }
  48. /**
  49. * Respond to a path being deleted.
  50. *
  51. * @param $path
  52. * An associative array containing the following keys:
  53. * - source: The internal system path.
  54. * - alias: The URL alias.
  55. * - pid: Unique path alias identifier.
  56. * - language: The language of the alias.
  57. *
  58. * @see path_delete()
  59. */
  60. function hook_path_delete($path) {
  61. db_delete('mytable')
  62. ->condition('pid', $path['pid'])
  63. ->execute();
  64. }
  65. /**
  66. * @} End of "addtogroup hooks".
  67. */

Functions

Namesort descending Description
hook_path_delete Respond to a path being deleted.
hook_path_insert Respond to a path being inserted.
hook_path_update Respond to a path being updated.