final class CacheableOmission in Drupal 9
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/Normalizer/Value/CacheableOmission.php \Drupal\jsonapi\Normalizer\Value\CacheableOmission
Represents the cacheability associated with the omission of a value.
@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.
Hierarchy
- class \Drupal\jsonapi\Normalizer\Value\CacheableNormalization implements CacheableDependencyInterface uses CacheableDependencyTrait
- class \Drupal\jsonapi\Normalizer\Value\CacheableOmission
Expanded class hierarchy of CacheableOmission
See also
https://www.drupal.org/project/drupal/issues/3032787
3 files declare their use of CacheableOmission
- JsonApiDocumentTopLevelNormalizer.php in core/
modules/ jsonapi/ src/ Normalizer/ JsonApiDocumentTopLevelNormalizer.php - LinkCollectionNormalizer.php in core/
modules/ jsonapi/ src/ Normalizer/ LinkCollectionNormalizer.php - ResourceObjectNormalizer.php in core/
modules/ jsonapi/ src/ Normalizer/ ResourceObjectNormalizer.php
File
- core/
modules/ jsonapi/ src/ Normalizer/ Value/ CacheableOmission.php, line 16
Namespace
Drupal\jsonapi\Normalizer\ValueView source
final class CacheableOmission extends CacheableNormalization {
/**
* CacheableOmission constructor.
*
* @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability
* Cacheability related to the omission of the normalization. For example,
* if a field is omitted because of an access result that varies by the
* `user.permissions` cache context, we need to associate that information
* with the response so that it will appear for a user *with* the
* appropriate permissions for that field.
*/
public function __construct(CacheableDependencyInterface $cacheability) {
parent::__construct($cacheability, NULL);
}
/**
* {@inheritdoc}
*/
public static function permanent($no_op = NULL) {
return parent::permanent(NULL);
}
/**
* A CacheableOmission should never have its normalization retrieved.
*/
public function getNormalization() {
throw new \LogicException('A CacheableOmission should never have its normalization retrieved.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
public | function | 4 | |
CacheableDependencyTrait:: |
public | function | 4 | |
CacheableDependencyTrait:: |
public | function | 4 | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
CacheableNormalization:: |
protected | property | A normalized value. | |
CacheableNormalization:: |
public static | function | Collects an array of CacheableNormalizations into a single instance. | |
CacheableNormalization:: |
protected static | function | Ensures that no nested values are instances of this class. | |
CacheableNormalization:: |
public | function | Converts the object to a CacheableOmission if the normalization is empty. | |
CacheableNormalization:: |
public | function | Gets a new CacheableNormalization with an additional dependency. | |
CacheableOmission:: |
public | function |
A CacheableOmission should never have its normalization retrieved. Overrides CacheableNormalization:: |
|
CacheableOmission:: |
public static | function |
Creates a CacheableNormalization instance without any special cacheability. Overrides CacheableNormalization:: |
|
CacheableOmission:: |
public | function |
CacheableOmission constructor. Overrides CacheableNormalization:: |