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

Breadcrumb

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

function ResourceObject::getVersionIdentifier

Gets a version identifier for the ResourceObject.

Return value

string The version identifier of the resource object, if the resource type is versionable.

File

core/modules/jsonapi/src/JsonApiResource/ResourceObject.php, line 199

Class

ResourceObject
Represents a JSON:API resource object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function getVersionIdentifier() {
    if (!$this->resourceType
        ->isVersionable()) {
        throw new \LogicException('Cannot get a version identifier for a non-versionable resource.');
    }
    return $this->versionIdentifier;
}

API Navigation

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