You are here

public function SocialCommentViewBuilder::buildMultiple in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_comment/src/SocialCommentViewBuilder.php \Drupal\social_comment\SocialCommentViewBuilder::buildMultiple()
  2. 10.0.x modules/social_features/social_comment/src/SocialCommentViewBuilder.php \Drupal\social_comment\SocialCommentViewBuilder::buildMultiple()
  3. 10.2.x modules/social_features/social_comment/src/SocialCommentViewBuilder.php \Drupal\social_comment\SocialCommentViewBuilder::buildMultiple()

Builds multiple entities' views; augments entity defaults.

This function is assigned as a #pre_render callback in ::viewMultiple().

By delaying the building of an entity until the #pre_render processing in drupal_render(), the processing cost of assembling an entity's renderable array is saved on cache-hit requests.

Parameters

array $build_list: A renderable array containing build information and context for an entity view.

Return value

array The updated renderable array.

Overrides EntityViewBuilder::buildMultiple

See also

\Drupal\Core\Render\RendererInterface::render()

File

modules/social_features/social_comment/src/SocialCommentViewBuilder.php, line 77

Class

SocialCommentViewBuilder
View builder handler for social comments.

Namespace

Drupal\social_comment

Code

public function buildMultiple(array $build_list) {
  $build_list = parent::buildMultiple($build_list);
  $tags = $build_list['pager']['#tags'] ?? [];
  $tags[] = self::PAGER_TAG;
  $build_list['pager']['#tags'] = $tags;
  return $build_list;
}