Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 6 |
TermViewBuilder | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
alterBuild | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 6 |
<?php | |
/** | |
* @file | |
* Contains \Drupal\taxonomy\TermViewBuilder. | |
*/ | |
namespace Drupal\taxonomy; | |
use Drupal\Core\Entity\Display\EntityViewDisplayInterface; | |
use Drupal\Core\Entity\EntityInterface; | |
use Drupal\Core\Entity\EntityViewBuilder; | |
/** | |
* Render controller for taxonomy terms. | |
*/ | |
class TermViewBuilder extends EntityViewBuilder { | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) { | |
parent::alterBuild($build, $entity, $display, $view_mode); | |
$build['#contextual_links']['taxonomy_term'] = array( | |
'route_parameters' => array('taxonomy_term' => $entity->id()), | |
'metadata' => array('changed' => $entity->getChangedTime()), | |
); | |
} | |
} |