function EntityTestViewBuilderOverriddenView::view

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php \Drupal\entity_test\EntityTestViewBuilderOverriddenView::view()
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php \Drupal\entity_test\EntityTestViewBuilderOverriddenView::view()
  3. 10 core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php \Drupal\entity_test\EntityTestViewBuilderOverriddenView::view()

Overrides EntityViewBuilder::view

1 call to EntityTestViewBuilderOverriddenView::view()
EntityTestViewBuilderOverriddenView::viewMultiple in core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php

File

core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php, line 17

Class

EntityTestViewBuilderOverriddenView
Provides a view builder that overrides ::view() and ::viewMultiple().

Namespace

Drupal\entity_test

Code

public function view(EntityInterface $entity, $view_mode = 'full', $langcode = NULL) {
    $build = [];
    $build[$entity->id()]['#plain_text'] = $entity->label();
    return $build;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.