function RevisionLink::get_revision_entity

Returns the revision values of a node.

Parameters

object $values: An object containing all retrieved values.

string $op: The operation being performed.

Return value

array A numerically indexed array containing the current node object and the revision ID for this row.

3 calls to RevisionLink::get_revision_entity()
RevisionLink::render_link in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php
RevisionLinkDelete::render_link in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php
RevisionLinkRevert::render_link in drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php

File

drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php, line 68
Definition of Drupal\node\Plugin\views\field\RevisionLink.

Class

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

Namespace

Drupal\node\Plugin\views\field

Code

function get_revision_entity($values, $op) {
  $vid = $this
    ->getValue($values, 'node_vid');
  $node = $this
    ->getEntity($values);

  // Unpublished nodes ignore access control.
  $node->status = 1;

  // Ensure user has access to perform the operation on this node.
  if (!node_access($op, $node)) {
    return array(
      $node,
      NULL,
    );
  }
  return array(
    $node,
    $vid,
  );
}