Version 1
[yaffs-website] / web / core / modules / views / src / EntityViewsDataInterface.php
diff --git a/web/core/modules/views/src/EntityViewsDataInterface.php b/web/core/modules/views/src/EntityViewsDataInterface.php
new file mode 100644 (file)
index 0000000..16b9af2
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\views;
+
+use Drupal\Core\Entity\EntityTypeInterface;
+
+/**
+ * Provides an interface to integrate an entity type with views.
+ */
+interface EntityViewsDataInterface {
+
+  /**
+   * Returns views data for the entity type.
+   *
+   * @return array
+   *   Views data in the format of hook_views_data().
+   */
+  public function getViewsData();
+
+  /**
+   * Gets the table of an entity type to be used as base table in views.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
+   *   The entity type.
+   *
+   * @return string
+   *   The name of the base table in views.
+   */
+  public function getViewsTableForEntityType(EntityTypeInterface $entity_type);
+
+}