You are here

protected function SupportTicketViewBuilder::alterBuild in Support Ticketing System 8

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

modules/support_ticket/src/SupportTicketViewBuilder.php, line 134
Contains \Drupal\support_ticket\SupportTicketViewBuilder.

Class

SupportTicketViewBuilder
Render controller for support tickets.

Namespace

Drupal\support_ticket

Code

protected function alterBuild(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {

  /** @var \Drupal\support_ticket\SupportTicketInterface $entity */
  parent::alterBuild($build, $entity, $display, $view_mode);
  if ($entity
    ->id()) {
    $build['#contextual_links']['support_ticket'] = array(
      'route_parameters' => array(
        'support_ticket' => $entity
          ->id(),
      ),
      'metadata' => array(
        'changed' => $entity
          ->getChangedTime(),
      ),
    );
  }
}