Get Entity data and metadata | Drupal 8

Get Entity data and metadata

Submitted by editor on Tue, 01/10/2017 - 13:11

How to get Entity type data and metadata

Get entity types list :

$itmes_list= \Drupal::entityTypeManager()->getDefinitions();

Get Entity type (Content / Config)


Get Label / Name



Load entity (dynamic type) from database

See :

Load a entity type using entityTypeManager

Example :
$nodeEntity = \Drupal::entityTypeManager()->getDefinition('node');

Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.