function VersionById::getRevisionId

Same name in other branches
  1. 9 core/modules/jsonapi/src/Revisions/VersionById.php \Drupal\jsonapi\Revisions\VersionById::getRevisionId()
  2. 8.9.x core/modules/jsonapi/src/Revisions/VersionById.php \Drupal\jsonapi\Revisions\VersionById::getRevisionId()
  3. 10 core/modules/jsonapi/src/Revisions/VersionById.php \Drupal\jsonapi\Revisions\VersionById::getRevisionId()

Overrides NegotiatorBase::getRevisionId

File

core/modules/jsonapi/src/Revisions/VersionById.php, line 21

Class

VersionById
Defines a revision ID implementation for entity revision ID values.

Namespace

Drupal\jsonapi\Revisions

Code

protected function getRevisionId(EntityInterface $entity, $version_argument) {
    if (!is_numeric($version_argument)) {
        throw new InvalidVersionIdentifierException('The revision ID must be an integer.');
    }
    return $version_argument;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.