class CacheableHttpException

Same name in other branches
  1. 9 core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php \Drupal\Core\Http\Exception\CacheableHttpException
  2. 8.9.x core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php \Drupal\Core\Http\Exception\CacheableHttpException
  3. 11.x core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php \Drupal\Core\Http\Exception\CacheableHttpException

A cacheable HttpException.

Hierarchy

Expanded class hierarchy of CacheableHttpException

2 files declare their use of CacheableHttpException
CacheableExceptionTest.php in core/tests/Drupal/Tests/Core/Http/CacheableExceptionTest.php
ResourceVersionRouteEnhancer.php in core/modules/jsonapi/src/Revisions/ResourceVersionRouteEnhancer.php

File

core/lib/Drupal/Core/Http/Exception/CacheableHttpException.php, line 12

Namespace

Drupal\Core\Http\Exception
View source
class CacheableHttpException extends HttpException implements CacheableDependencyInterface {
    use CacheableDependencyTrait;
    
    /**
     * {@inheritdoc}
     */
    public function __construct(CacheableDependencyInterface $cacheability, $statusCode = 0, $message = '', ?\Exception $previous = NULL, array $headers = [], $code = 0) {
        $this->setCacheability($cacheability);
        parent::__construct($statusCode, $message, $previous, $headers, $code);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 4
CacheableDependencyTrait::getCacheMaxAge public function 4
CacheableDependencyTrait::getCacheTags public function 4
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
CacheableHttpException::__construct public function

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