You are here

function RevisionLink::get_revision_entity in Views (for Drupal 7) 8.3

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 lib/Views/node/Plugin/views/field/RevisionLink.php
RevisionLinkDelete::render_link in lib/Views/node/Plugin/views/field/RevisionLinkDelete.php
RevisionLinkRevert::render_link in lib/Views/node/Plugin/views/field/RevisionLinkRevert.php

File

lib/Views/node/Plugin/views/field/RevisionLink.php, line 70
Definition of Views\node\Plugin\views\field\RevisionLink.

Class

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

Namespace

Views\node\Plugin\views\field

Code

function get_revision_entity($values, $op) {
  $vid = $this
    ->get_value($values, 'node_vid');
  $node = $this
    ->get_value($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,
  );
}