Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / taxonomy_vocabulary_load.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_load.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/taxonomy_vocabulary_load.twig
new file mode 100644 (file)
index 0000000..0978510
--- /dev/null
@@ -0,0 +1,12 @@
+/**
+ * Implements hook_taxonomy_vocabulary_load().
+ */
+function {{ machine_name }}_taxonomy_vocabulary_load($vocabularies) {
+  $result = db_select('mytable', 'm')
+    ->fields('m', array('vid', 'foo'))
+    ->condition('m.vid', array_keys($vocabularies), 'IN')
+    ->execute();
+  foreach ($result as $record) {
+    $vocabularies[$record->vid]->foo = $record->foo;
+  }
+}