You are here

protected function EntityNormalizer::getFieldNames in JSON:API 8

Gets the field names for the given entity.

Parameters

mixed $entity: The entity.

string $bundle: The entity bundle.

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The resource type.

Return value

string[] The field names.

1 call to EntityNormalizer::getFieldNames()
EntityNormalizer::normalize in src/Normalizer/EntityNormalizer.php
Normalizes an object into a set of arrays/scalars.

File

src/Normalizer/EntityNormalizer.php, line 164

Class

EntityNormalizer
Converts the Drupal entity object to a JSON API array structure.

Namespace

Drupal\jsonapi\Normalizer

Code

protected function getFieldNames($entity, $bundle, ResourceType $resource_type) {

  /* @var \Drupal\Core\Entity\ContentEntityInterface $entity */
  return array_keys($this
    ->getFields($entity, $bundle, $resource_type));
}