Skip to content
Snippets Groups Projects
Commit 1b859085 authored by Angie Byron's avatar Angie Byron
Browse files

#929208 by heyrocker, duellj: Fixed Path hook api docs are missing function bodies

parent 27b8a368
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -13,30 +13,61 @@
/**
* The path has been inserted.
* Allow modules to respond to a path being inserted.
*
* @param $path
* The path array.
* An associative array containing the following keys:
* - source: The internal system path.
* - alias: The URL alias.
* - pid: Unique path alias identifier.
* - language: The language of the alias.
*
* @see path_save()
*/
function hook_path_insert($path) {
db_insert('mytable')
->fields(array(
'alias' => $path['alias'],
'pid' => $path['pid'],
))
->execute();
}
/**
* The path has been updated.
* Allow modules to respond to a path being updated.
*
* @param $path
* The path array.
* An associative array containing the following keys:
* - source: The internal system path.
* - alias: The URL alias.
* - pid: Unique path alias identifier.
* - language: The language of the alias.
*
* @see path_save()
*/
function hook_path_update($path) {
db_update('mytable')
->fields(array('alias' => $path['alias']))
->condition('pid', $path['pid'])
->execute();
}
/**
* The path has been deleted.
* Allow modules to respond to a path being deleted.
*
* @param $path
* The path array.
* An associative array containing the following keys:
* - source: The internal system path.
* - alias: The URL alias.
* - pid: Unique path alias identifier.
* - language: The language of the alias.
*
* @see path_delete()
*/
function hook_path_delete($path) {
db_delete('mytable')
->condition('pid', $path['pid'])
->execute();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment