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.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_storage_details.twig
new file mode 100644 (file)
index 0000000..2c72e67
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * Implements hook_field_storage_details().
+ */
+function {{ machine_name }}_field_storage_details($field) {
+  $details = array();
+
+  // Add field columns.
+  foreach ((array) $field['columns'] as $column_name => $attributes) {
+    $real_name = _field_sql_storage_columnname($field['field_name'], $column_name);
+    $columns[$column_name] = $real_name;
+  }
+  return array(
+    'sql' => array(
+      FIELD_LOAD_CURRENT => array(
+        _field_sql_storage_tablename($field) => $columns,
+      ),
+      FIELD_LOAD_REVISION => array(
+        _field_sql_storage_revision_tablename($field) => $columns,
+      ),
+    ),
+  );
+}