function RevisionLink::renderLink

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

Overrides LinkBase::renderLink

File

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

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 || !$node->getRevisionid()) {
        return '';
    }
    $text = parent::renderLink($row);
    $this->options['alter']['query'] = $this->getDestinationArray();
    return $text;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.