ResourceVersionRouteEnhancer
final class ResourceVersionRouteEnhancer implements EnhancerInterface (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. |
Loads an appropriate revision for the requested resource version.
Constants
| REVISION_ID_KEY |
The route default parameter name. |
| RESOURCE_VERSION_QUERY_PARAMETER |
The query parameter for providing a version (revision) value. |
| WORKING_COPIES_REQUESTED |
A route parameter key which indicates that working copies were requested. |
| CACHE_CONTEXT |
The cache context by which vary the loaded entity revision. |
| VERSION_IDENTIFIER_VALIDATOR |
Resource version validation regex. |
Properties
| protected VersionNegotiator | $versionNegotiator | The revision ID negotiator. |
Methods
__construct(VersionNegotiator $version_negotiator_manager)
ResourceVersionRouteEnhancer constructor.
array
enhance(array $defaults, Request $request)
Updates the defaults for a route definition based on the request.
static bool
isValidVersionIdentifier(string $resource_version)
Validates the user input.
Details
__construct(VersionNegotiator $version_negotiator_manager)
ResourceVersionRouteEnhancer constructor.
array
enhance(array $defaults, Request $request)
Updates the defaults for a route definition based on the request.
static protected bool
isValidVersionIdentifier(string $resource_version)
Validates the user input.