protected function GroupViewBuilder::alterBuild in Group 2.0.x
Same name and namespace in other branches
- 8 src/Entity/ViewBuilder/GroupViewBuilder.php \Drupal\group\Entity\ViewBuilder\GroupViewBuilder::alterBuild()
Specific per-entity building.
Parameters
array $build: The render array that is being created.
\Drupal\Core\Entity\EntityInterface $entity: The entity to be prepared.
\Drupal\Core\Entity\Display\EntityViewDisplayInterface $display: The entity view display holding the display options configured for the entity components.
string $view_mode: The view mode that should be used to prepare the entity.
Overrides EntityViewBuilder::alterBuild
File
- src/
Entity/ ViewBuilder/ GroupViewBuilder.php, line 19
Class
- GroupViewBuilder
- View builder handler for groups.
Namespace
Drupal\group\Entity\ViewBuilderCode
protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
/** @var \Drupal\group\Entity\GroupInterface $entity */
parent::alterBuild($build, $entity, $display, $view_mode);
if ($entity
->id()) {
$build['#contextual_links']['group'] = [
'route_parameters' => [
'group' => $entity
->id(),
],
'metadata' => [
'changed' => $entity
->getChangedTime(),
],
];
}
}