You are here

public function StaticDataDefinitionExtractor::extractField in JSON:API Schema 8

File

src/StaticDataDefinitionExtractor.php, line 103

Class

StaticDataDefinitionExtractor
Extracts the data definition for entities of an entity type.

Namespace

Drupal\jsonapi_schema

Code

public function extractField(EntityTypeInterface $entity_type, $bundle, $field_name) {
  $definition = $this
    ->extract($entity_type, $bundle);
  return $definition
    ->getPropertyDefinition($field_name) ?: DataDefinition::createFromDataType('undefined');
}