Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / module_implements_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/module_implements_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/module_implements_alter.twig
new file mode 100644 (file)
index 0000000..7fbe125
--- /dev/null
@@ -0,0 +1,14 @@
+/**
+ * Implements hook_module_implements_alter().
+ */
+function {{ machine_name }}_module_implements_alter(&$implementations, $hook) {
+  if ($hook == 'rdf_mapping') {
+    // Move my_module_rdf_mapping() to the end of the list. module_implements()
+    // iterates through $implementations with a foreach loop which PHP iterates
+    // in the order that the items were added, so to move an item to the end of
+    // the array, we remove it and then add it.
+    $group = $implementations['my_module'];
+    unset($implementations['my_module']);
+    $implementations['my_module'] = $group;
+  }
+}