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

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.