class RevisionLinkDelete

Same name and namespace in other branches
  1. 11.x core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php \Drupal\node\Plugin\views\field\RevisionLinkDelete
  2. 10 core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php \Drupal\node\Plugin\views\field\RevisionLinkDelete

Field handler to present link to delete a node revision.

Plugin annotation

@ViewsField("node_revision_link_delete");

Hierarchy

Expanded class hierarchy of RevisionLinkDelete

Related topics

File

core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php, line 15

Namespace

Drupal\node\Plugin\views\field
View source
class RevisionLinkDelete extends RevisionLink {
  
  /**
   * {@inheritdoc}
   */
  protected function getUrlInfo(ResultRow $row) {
    /** @var \Drupal\node\NodeInterface $node */
    $node = $this->getEntity($row);
    return Url::fromRoute('node.revision_delete_confirm', [
      'node' => $node->id(),
      'node_revision' => $node->getRevisionId(),
    ]);
  }
  
  /**
   * {@inheritdoc}
   */
  protected function getDefaultLabel() {
    return $this->t('Delete');
  }

}

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