You are here

protected function RevisionLink::getUrlInfo in Support Ticketing System 8

Returns the URI elements of the link.

Parameters

\Drupal\views\ResultRow $row: A view result row.

Return value

\Drupal\Core\Url The URI elements of the link.

Overrides LinkBase::getUrlInfo

2 methods override RevisionLink::getUrlInfo()
RevisionLinkDelete::getUrlInfo in modules/support_ticket/src/Plugin/views/field/RevisionLinkDelete.php
Returns the URI elements of the link.
RevisionLinkRevert::getUrlInfo in modules/support_ticket/src/Plugin/views/field/RevisionLinkRevert.php
Returns the URI elements of the link.

File

modules/support_ticket/src/Plugin/views/field/RevisionLink.php, line 26
Contains \Drupal\support_ticket\Plugin\views\field\RevisionLink.

Class

RevisionLink
Field handler to present a link to a support ticket revision.

Namespace

Drupal\support_ticket\Plugin\views\field

Code

protected function getUrlInfo(ResultRow $row) {

  /** @var \Drupal\support_ticket\SupportTicketInterface $support_ticket */
  $support_ticket = $this
    ->getEntity($row);

  // Current revision uses the support ticket view path.
  return !$support_ticket
    ->isDefaultRevision() ? Url::fromRoute('entity.support_ticket.revision', [
    'support_ticket' => $support_ticket
      ->id(),
    'support_ticket_revision' => $support_ticket
      ->getRevisionId(),
  ]) : $support_ticket
    ->urlInfo();
}