You are here

public static function SupportTicketViewBuilder::renderLinks in Support Ticketing System 8

#lazy_builder callback; builds a support ticket's links.

Parameters

string $support_ticket_entity_id: The support ticket entity ID.

string $view_mode: The view mode in which the support ticket entity is being viewed.

string $langcode: The language in which the support ticket entity is being viewed.

Return value

array A renderable array representing the support ticket links.

File

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

Class

SupportTicketViewBuilder
Render controller for support tickets.

Namespace

Drupal\support_ticket

Code

public static function renderLinks($support_ticket_entity_id, $view_mode, $langcode) {
  $links = array(
    '#theme' => 'links__support_ticket',
    '#pre_render' => array(
      'drupal_pre_render_links',
    ),
    '#attributes' => array(
      'class' => array(
        'links',
        'inline',
      ),
    ),
  );
  $entity = SupportTicket::load($support_ticket_entity_id)
    ->getTranslation($langcode);
  $links['support_ticket'] = static::buildLinks($entity, $view_mode);

  // Allow other modules to alter the support_ticket links.
  $hook_context = array(
    'view_mode' => $view_mode,
    'langcode' => $langcode,
  );
  \Drupal::moduleHandler()
    ->alter('support_ticket_links', $links, $entity, $hook_context);
  return $links;
}