Skip to content

Commit b00fbaf

Browse files
committed
Add snippets for hook_update_N (for .install files)
1 parent d4e2205 commit b00fbaf

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

snippets/drupal.snippets

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3044,6 +3044,17 @@ snippet h_language_fallback_candidates_alter
30443044
function `Filename()`_language_fallback_candidates_alter(array &$fallback_candidates) {
30453045
${1:/* Your code here */}
30463046
}
3047+
snippet h_update_N
3048+
/**
3049+
* Implements hook_update_N().
3050+
*/
3051+
function `Filename()`_update_${1:/* Update number */}(&$sandbox = NULL) {
3052+
$ret = t('${2:/* Message */}');
3053+
3054+
${3:/* Your code here */}
3055+
3056+
return $ret;
3057+
}
30473058
snippet hook_simpletest_alter
30483059
/**
30493060
* Implements hook_simpletest_alter().
@@ -9199,4 +9210,18 @@ snippet hook_language_fallback_candidates_alter
91999210
*$fallback_candidates = array_reverse($fallback_candidates);
92009211
*/
92019212
${1:/* Your code here */}
9202-
}
9213+
9214+
snippet hook_update_N
9215+
/**
9216+
* Implements hook_update_N().
9217+
*/
9218+
function `Filename()`_update_${1:/* Update number */}(&$sandbox = NULL) {
9219+
/*
9220+
* Message shown when the update is successful
9221+
*/
9222+
$ret = t('${2:/* Message */}');
9223+
9224+
${3:/* Your code here */}
9225+
9226+
return $ret;
9227+
}

0 commit comments

Comments
 (0)