Mercurial > hg > isophonics-drupal-site
comparison core/modules/taxonomy/src/TermViewBuilder.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\taxonomy; | 3 namespace Drupal\taxonomy; |
4 | 4 |
5 use Drupal\Core\Entity\Display\EntityViewDisplayInterface; | 5 @trigger_error(__NAMESPACE__ . '\TermViewBuilder is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityViewBuilder instead. See https://www.drupal.org/node/2924233.', E_USER_DEPRECATED); |
6 use Drupal\Core\Entity\EntityInterface; | 6 |
7 use Drupal\Core\Entity\EntityViewBuilder; | 7 use Drupal\Core\Entity\EntityViewBuilder; |
8 | 8 |
9 /** | 9 /** |
10 * View builder handler for taxonomy terms. | 10 * View builder handler for taxonomy terms. |
11 * | |
12 * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. | |
13 * Use \Drupal\Core\Entity\EntityViewBuilder instead. | |
14 * | |
15 * @see \Drupal\Core\Entity\EntityViewBuilder | |
16 * @see https://www.drupal.org/node/2924233 | |
11 */ | 17 */ |
12 class TermViewBuilder extends EntityViewBuilder { | 18 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 } |