You are here

public function IngredientViewsData::getViewsData in Recipe 8.2

Returns views data for the entity type.

Return value

array Views data in the format of hook_views_data().

Overrides EntityViewsData::getViewsData

File

modules/ingredient/src/IngredientViewsData.php, line 15

Class

IngredientViewsData
Provides the views data for the ingredient entity type.

Namespace

Drupal\ingredient

Code

public function getViewsData() {
  $data = parent::getViewsData();
  $data['ingredient_field_data']['table']['base']['access query tag'] = 'ingredient_access';
  $data['ingredient_field_data']['table']['wizard_id'] = 'ingredient';
  $data['ingredient_field_data']['id']['argument'] = [
    'id' => 'ingredient_id',
    'name field' => 'name',
    'numeric' => TRUE,
    'validate type' => 'id',
  ];
  return $data;
}