You are here

function user_revision_ids in User Revision 8

Returns a list of user revision IDs for a specific user.

Parameters

\Drupal\user\UserInterface: The user entity.

Return value

int[] User revision IDs (in ascending order).

1 call to user_revision_ids()
UserController::revisionOverview in src/Controller/UserController.php
Generates an overview table of older revisions of a user.

File

./user_revision.module, line 289
User Revision module.

Code

function user_revision_ids(UserInterface $user) {
  $entity_type = \Drupal::service('entity_type.manager')
    ->getStorage('user')
    ->getEntityType();
  return \Drupal::database()
    ->query('SELECT vid FROM {' . $entity_type
    ->getRevisionTable() . '} WHERE uid=:uid ORDER BY vid', array(
    ':uid' => $user
      ->id(),
  ))
    ->fetchCol();
}