function EntityDebugController::entityTypeDefinition

Same name in other branches
  1. 5.x src/Controller/EntityDebugController.php \Drupal\devel\Controller\EntityDebugController::entityTypeDefinition()

Returns the entity type definition of the current entity.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: A RouteMatch object.

Return value

array Array of page elements to render.

File

src/Controller/EntityDebugController.php, line 53

Class

EntityDebugController
Controller for devel entity debug.

Namespace

Drupal\devel\Controller

Code

public function entityTypeDefinition(RouteMatchInterface $route_match) {
    $output = [];
    $entity = $this->getEntityFromRouteMatch($route_match);
    if ($entity instanceof EntityInterface) {
        $output = $this->dumper
            ->exportAsRenderable($entity->getEntityType());
    }
    return $output;
}