You are here

public function PluginRevisionController::getRevisionIds in Diff 8

Get all the revision ids of given entity id.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage manager.

int $entity_id: The entity to find revisions of.

Return value

int[] The revision ids.

1 call to PluginRevisionController::getRevisionIds()
PluginRevisionController::compareEntityRevisions in src/Controller/PluginRevisionController.php
Returns a table which shows the differences between two entity revisions.

File

src/Controller/PluginRevisionController.php, line 89

Class

PluginRevisionController
Base class for controllers that return responses on entity revision routes.

Namespace

Drupal\diff\Controller

Code

public function getRevisionIds(EntityStorageInterface $storage, $entity_id) {
  $result = $storage
    ->getQuery()
    ->allRevisions()
    ->condition($storage
    ->getEntityType()
    ->getKey('id'), $entity_id)
    ->accessCheck(FALSE)
    ->execute();
  $result_array = array_keys($result);
  sort($result_array);
  return $result_array;
}