protected static function VersionNegotiator::throwNotFoundHttpException in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/Revisions/VersionNegotiator.php \Drupal\jsonapi\Revisions\VersionNegotiator::throwNotFoundHttpException()
- 10 core/modules/jsonapi/src/Revisions/VersionNegotiator.php \Drupal\jsonapi\Revisions\VersionNegotiator::throwNotFoundHttpException()
Throws a cacheable error exception.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity for which a revision was requested.
string $resource_version_identifier: The user input for the revision negotiation.
Throws
\Drupal\Core\Http\Exception\CacheableNotFoundHttpException
1 call to VersionNegotiator::throwNotFoundHttpException()
- VersionNegotiator::getRevision in core/modules/ jsonapi/ src/ Revisions/ VersionNegotiator.php 
- Gets a negotiated entity revision.
File
- core/modules/ jsonapi/ src/ Revisions/ VersionNegotiator.php, line 92 
Class
- VersionNegotiator
- Provides a version negotiator manager.
Namespace
Drupal\jsonapi\RevisionsCode
protected static function throwNotFoundHttpException(EntityInterface $entity, $resource_version_identifier) {
  $cacheability = CacheableMetadata::createFromObject($entity)
    ->addCacheContexts([
    'url.path',
    'url.query_args:' . ResourceVersionRouteEnhancer::RESOURCE_VERSION_QUERY_PARAMETER,
  ]);
  $reason = sprintf('The requested version, identified by `%s`, could not be found.', $resource_version_identifier);
  throw new CacheableNotFoundHttpException($cacheability, $reason);
}