Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NodeController.php

function NodeController::getRevisionIds

Gets a list of node revision IDs for a specific node.

Parameters

\Drupal\node\NodeInterface $node: The node entity.

\Drupal\node\NodeStorageInterface $node_storage: The node storage handler.

Return value

int[] Node revision IDs (in descending order).

1 call to NodeController::getRevisionIds()
NodeController::revisionOverview in core/modules/node/src/Controller/NodeController.php
Generates an overview table of older revisions of a node.

File

core/modules/node/src/Controller/NodeController.php, line 288

Class

NodeController
Returns responses for Node routes.

Namespace

Drupal\node\Controller

Code

protected function getRevisionIds(NodeInterface $node, NodeStorageInterface $node_storage) {
    $result = $node_storage->getQuery()
        ->accessCheck(TRUE)
        ->allRevisions()
        ->condition($node->getEntityType()
        ->getKey('id'), $node->id())
        ->sort($node->getEntityType()
        ->getKey('revision'), 'DESC')
        ->pager(50)
        ->execute();
    return array_keys($result);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal