You are here

public function NullFieldNormalizerValue::__construct in JSON:API 8

Instantiate a FieldNormalizerValue object.

Parameters

\Drupal\Core\Access\AccessResultInterface $field_access_result: The field access result.

string $property_type: The property type of the field: 'attributes' or 'relationships'.

File

src/Normalizer/Value/NullFieldNormalizerValue.php, line 32

Class

NullFieldNormalizerValue
Normalizes null fields in accordance with the JSON API specification.

Namespace

Drupal\jsonapi\Normalizer\Value

Code

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;
}