protected function ViewsData::processEntityTypes

Links tables with 'entity type' to respective generic entity-type tables.

Parameters

array $data: The array of data to alter entity data for, passed by reference.

1 call to ViewsData::processEntityTypes()
ViewsData::getData in drupal/core/modules/views/lib/Drupal/views/ViewsData.php
Gets all data invoked by hook_views_data().

File

drupal/core/modules/views/lib/Drupal/views/ViewsData.php, line 210
Contains \Drupal\views\ViewsData.

Class

ViewsData
Class to manage and lazy load cached views data.

Namespace

Drupal\views

Code

protected function processEntityTypes(array &$data) {
  foreach ($data as $table_name => $table_info) {

    // Add in a join from the entity-table if an entity-type is given.
    if (!empty($table_info['table']['entity type'])) {
      $entity_table = 'views_entity_' . $table_info['table']['entity type'];
      $data[$entity_table]['table']['join'][$table_name] = array(
        'left_table' => $table_name,
      );
      $data[$entity_table]['table']['entity type'] = $table_info['table']['entity type'];

      // Copy over the default table group if we have none yet.
      if (!empty($table_info['table']['group']) && empty($data[$entity_table]['table']['group'])) {
        $data[$entity_table]['table']['group'] = $table_info['table']['group'];
      }
    }
  }
}