You are here

protected function NormalizerBase::requiredProperty in Schemata 8

Determine if the given property is a required element of the schema.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $property: The data property to be evaluated.

Return value

bool Whether the property should be treated as required for schema purposes.

3 calls to NormalizerBase::requiredProperty()
DataDefinitionNormalizer::normalize in schemata_json_schema/src/Normalizer/json/DataDefinitionNormalizer.php
Normalizes an object into a set of arrays/scalars.
ListDataDefinitionNormalizer::normalize in schemata_json_schema/src/Normalizer/json/ListDataDefinitionNormalizer.php
Normalizes an object into a set of arrays/scalars.
ListDataDefinitionNormalizer::normalize in schemata_json_schema/src/Normalizer/jsonapi/ListDataDefinitionNormalizer.php
Normalizes an object into a set of arrays/scalars.

File

src/Normalizer/NormalizerBase.php, line 73

Class

NormalizerBase
Base class for JSON Schema Normalizers.

Namespace

Drupal\schemata\Normalizer

Code

protected function requiredProperty(DataDefinitionInterface $property) {
  return $property
    ->isReadOnly() || $property
    ->isRequired();
}