EntityViewsDataInterface.php 759 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
<?php

/**
 * @file
 * Contains \Drupal\views\EntityViewsDataInterface.
 */

namespace Drupal\views;

10 11
use Drupal\Core\Entity\EntityTypeInterface;

12 13 14 15 16 17 18 19 20 21 22 23 24
/**
 * 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();

25 26 27 28 29 30 31 32 33 34 35
  /**
   * 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);

36
}