function EntityTestViewBuilderOverriddenView::viewMultiple

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

Overrides EntityViewBuilder::viewMultiple

File

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

Class

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

Namespace

Drupal\entity_test

Code

public function viewMultiple(array $entities = [], $view_mode = 'full', $langcode = NULL) {
    $build = [];
    foreach ($entities as $key => $entity) {
        $build[$key] = $this->view($entity, $view_mode, $langcode);
    }
    return $build;
}

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