You are here

protected static function SchemataSchemaNormalizer::getProperties in Schemata 8

Same name in this branch
  1. 8 schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php \Drupal\schemata_json_schema\Normalizer\jsonapi\SchemataSchemaNormalizer::getProperties()
  2. 8 schemata_json_schema/src/Normalizer/json/SchemataSchemaNormalizer.php \Drupal\schemata_json_schema\Normalizer\json\SchemataSchemaNormalizer::getProperties()

Identify properties of the data definition to normalize.

This allow subclasses of the normalizer to build white or blacklisting functionality on what will be included in the serialized schema. The JSON Schema serializer already has logic to drop any properties that are empty values after processing, but this allows cleaner, centralized logic.

Parameters

\Drupal\schemata\Schema\SchemaInterface $entity: The Schema object whose properties the serializer will present.

string $format: The serializer format. Defaults to NULL.

array $context: The current serializer context.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] The DataDefinitions to be processed.

1 call to SchemataSchemaNormalizer::getProperties()
SchemataSchemaNormalizer::normalize in schemata_json_schema/src/Normalizer/json/SchemataSchemaNormalizer.php
Normalizes an object into a set of arrays/scalars.

File

schemata_json_schema/src/Normalizer/json/SchemataSchemaNormalizer.php, line 69

Class

SchemataSchemaNormalizer
Primary normalizer for SchemaInterface objects.

Namespace

Drupal\schemata_json_schema\Normalizer\json

Code

protected static function getProperties(SchemaInterface $entity, $format = NULL, array $context = []) {
  return $entity
    ->getProperties();
}