Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / src / Drupal / Driver / Fields / FieldHandlerInterface.php
diff --git a/vendor/drupal/drupal-driver/src/Drupal/Driver/Fields/FieldHandlerInterface.php b/vendor/drupal/drupal-driver/src/Drupal/Driver/Fields/FieldHandlerInterface.php
new file mode 100644 (file)
index 0000000..784463e
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\Driver\Fields;
+
+/**
+ * Interface for handling fields.
+ *
+ * Saving fields on entities is handled differently depending on the Drupal
+ * version. This interface translates abstract field data into the format that
+ * is expected by the different storage handlers.
+ */
+interface FieldHandlerInterface {
+
+  /**
+   * Expand abstract field values so they can be saved on the entity.
+   *
+   * This method takes care of the different ways that field data is saved on
+   * entities in different versions of Drupal.
+   *
+   * @param mixed $values
+   *   A single value or an array of field values to save on the entity.
+   *
+   * @return array
+   *   An array of field values in the format expected by the entity storage
+   *   handlers in the driver's version of Drupal.
+   */
+  public function expand($values);
+
+}