Skip to content

Commit

Permalink
Remove duplicate declaration of Views base table. (#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen authored and enzolutions committed Dec 20, 2016
1 parent ee702af commit b4483c9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions templates/module/src/Entity/entity-content-views-data.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,22 @@ namespace Drupal\{{ module }}\Entity;

{% block use_class %}
use Drupal\views\EntityViewsData;
use Drupal\views\EntityViewsDataInterface;
{% endblock %}

{% block class_declaration %}
/**
* Provides Views data for {{ label }} entities.
*/
class {{ entity_class }}ViewsData extends EntityViewsData implements EntityViewsDataInterface {% endblock %}
class {{ entity_class }}ViewsData extends EntityViewsData {% endblock %}
{% block class_methods %}
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = parent::getViewsData();

$data['{{ entity_name }}']['table']['base'] = array(
'field' => 'id',
'title' => $this->t('{{ label }}'),
'help' => $this->t('The {{ label }} ID.'),
);
// Additional information for Views integration, such as table joins, can be
// put here.

return $data;
}
Expand Down

0 comments on commit b4483c9

Please sign in to comment.