Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / path_update.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_update.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/path_update.twig
new file mode 100644 (file)
index 0000000..4c6b157
--- /dev/null
@@ -0,0 +1,11 @@
+/**
+ * Implements hook_path_update().
+ */
+function {{ machine_name }}_path_update($path) {
+  if ($path['alias'] != $path['original']['alias']) {
+    db_update('mytable')
+      ->fields(['alias' => $path['alias']])
+      ->condition('pid', $path['pid'])
+      ->execute();
+  }
+}