Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / taxonomy / src / TermViewBuilder.php
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 }