Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_storage_details_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details_alter.twig
new file mode 100644 (file)
index 0000000..8d9d248
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * Implements hook_field_storage_details_alter().
+ */
+function {{ machine_name }}_field_storage_details_alter(&$details, $field) {
+  if ($field['field_name'] == 'field_of_interest') {
+    $columns = array();
+    foreach ((array) $field['columns'] as $column_name => $attributes) {
+      $columns[$column_name] = $column_name;
+    }
+    $details['drupal_variables'] = array(
+      FIELD_LOAD_CURRENT => array(
+        'moon' => $columns,
+      ),
+      FIELD_LOAD_REVISION => array(
+        'mars' => $columns,
+      ),
+    );
+  }
+}