You are here

protected function RevisionLink::renderLink in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/src/Plugin/views/field/RevisionLink.php \Drupal\node\Plugin\views\field\RevisionLink::renderLink()
  2. 10 core/modules/node/src/Plugin/views/field/RevisionLink.php \Drupal\node\Plugin\views\field\RevisionLink::renderLink()

Prepares the link to view a entity.

Parameters

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

Return value

string Returns a string for the link text.

Overrides LinkBase::renderLink

File

core/modules/node/src/Plugin/views/field/RevisionLink.php, line 33

Class

RevisionLink
Field handler to present a link to a node revision.

Namespace

Drupal\node\Plugin\views\field

Code

protected function renderLink(ResultRow $row) {

  /** @var \Drupal\node\NodeInterface $node */
  $node = $this
    ->getEntity($row);
  if (!$node
    ->getRevisionid()) {
    return '';
  }
  $text = parent::renderLink($row);
  $this->options['alter']['query'] = $this
    ->getDestinationArray();
  return $text;
}