VersionNegotiator
class VersionNegotiator (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
Provides a version negotiator manager.
Constants
| SEPARATOR |
The separator between the version negotiator name and the version argument. |
Properties
| protected VersionNegotiatorInterface[] | $negotiators | An array of named version negotiators. |
Methods
addVersionNegotiator(VersionNegotiatorInterface $version_negotiator, string $negotiator_name)
Adds a version negotiator.
getRevision(EntityInterface $entity, string $resource_version_identifier)
Gets a negotiated entity revision.
static
throwNotFoundHttpException(EntityInterface $entity, string $resource_version_identifier)
Throws a cacheable error exception.
static
throwBadRequestHttpException(string $resource_version_identifier)
Throws a cacheable error exception.
Details
addVersionNegotiator(VersionNegotiatorInterface $version_negotiator, string $negotiator_name)
Adds a version negotiator.
EntityInterface
getRevision(EntityInterface $entity, string $resource_version_identifier)
Gets a negotiated entity revision.
static protected
throwNotFoundHttpException(EntityInterface $entity, string $resource_version_identifier)
Throws a cacheable error exception.
static protected
throwBadRequestHttpException(string $resource_version_identifier)
Throws a cacheable error exception.