From 1b8590856f54046e78c3c31c9304925655a46371 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 2 Dec 2010 00:22:20 +0000 Subject: #929208 by heyrocker, duellj: Fixed Path hook api docs are missing function bodies --- modules/path/path.api.php | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'modules/path') diff --git a/modules/path/path.api.php b/modules/path/path.api.php index 3dd82940e..54a5c006b 100644 --- a/modules/path/path.api.php +++ b/modules/path/path.api.php @@ -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(); } /** -- cgit v1.2.3