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