class NullFieldNormalizerValue in JSON:API 8
Normalizes null fields in accordance with the JSON API specification.
@internal
Hierarchy
- class \Drupal\jsonapi\Normalizer\Value\NullFieldNormalizerValue implements FieldNormalizerValueInterface uses CacheableDependencyTrait
Expanded class hierarchy of NullFieldNormalizerValue
3 files declare their use of NullFieldNormalizerValue
- EntityNormalizer.php in src/
Normalizer/ EntityNormalizer.php - EntityReferenceFieldNormalizer.php in src/
Normalizer/ EntityReferenceFieldNormalizer.php - FieldNormalizer.php in src/
Normalizer/ FieldNormalizer.php
File
- src/
Normalizer/ Value/ NullFieldNormalizerValue.php, line 13
Namespace
Drupal\jsonapi\Normalizer\ValueView source
class NullFieldNormalizerValue implements FieldNormalizerValueInterface {
use CacheableDependencyTrait;
/**
* The property type.
*
* @var mixed
*/
protected $propertyType;
/**
* Instantiate a FieldNormalizerValue object.
*
* @param \Drupal\Core\Access\AccessResultInterface $field_access_result
* The field access result.
* @param string $property_type
* The property type of the field: 'attributes' or 'relationships'.
*/
public function __construct(AccessResultInterface $field_access_result, $property_type) {
assert($property_type === 'attributes' || $property_type === 'relationships');
$this
->setCacheability($field_access_result);
$this->propertyType = $property_type;
}
/**
* {@inheritdoc}
*/
public function getIncludes() {
return [];
}
/**
* {@inheritdoc}
*/
public function getPropertyType() {
return $this->propertyType;
}
/**
* {@inheritdoc}
*/
public function rasterizeValue() {
return NULL;
}
/**
* {@inheritdoc}
*/
public function rasterizeIncludes() {
return [];
}
/**
* {@inheritdoc}
*/
public function getAllIncludes() {
return NULL;
}
}