You are here

public function EntityTypeInfoController::entityTypeFields in Devel 8.3

Same name and namespace in other branches
  1. 4.x src/Controller/EntityTypeInfoController.php \Drupal\devel\Controller\EntityTypeInfoController::entityTypeFields()

Returns a render array representation of the entity type field definitions.

Parameters

string $entity_type_id: The name of the entity type to retrieve.

Return value

array A render array containing the entity type field definitions.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException If the requested entity type is not defined.

1 string reference to 'EntityTypeInfoController::entityTypeFields'
devel.routing.yml in ./devel.routing.yml
devel.routing.yml

File

src/Controller/EntityTypeInfoController.php, line 171

Class

EntityTypeInfoController
Provides route responses for the entity types info page.

Namespace

Drupal\devel\Controller

Code

public function entityTypeFields($entity_type_id) {
  if (!$this
    ->entityTypeManager()
    ->getDefinition($entity_type_id, FALSE)) {
    throw new NotFoundHttpException();
  }
  $field_storage_definitions = $this->entityLastInstalledSchemaRepository
    ->getLastInstalledFieldStorageDefinitions($entity_type_id);
  return $this->dumper
    ->exportAsRenderable($field_storage_definitions, $entity_type_id);
}