comparison core/modules/taxonomy/src/TermViewBuilder.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\taxonomy;
4
5 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
6 use Drupal\Core\Entity\EntityInterface;
7 use Drupal\Core\Entity\EntityViewBuilder;
8
9 /**
10 * View builder handler for taxonomy terms.
11 */
12 class TermViewBuilder extends EntityViewBuilder {
13
14 /**
15 * {@inheritdoc}
16 */
17 protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
18 parent::alterBuild($build, $entity, $display, $view_mode);
19 $build['#contextual_links']['taxonomy_term'] = [
20 'route_parameters' => ['taxonomy_term' => $entity->id()],
21 'metadata' => ['changed' => $entity->getChangedTime()],
22 ];
23 }
24
25 }