Hi,

in my module i would like to list all config entities in my drupal 8 website,

how to do ?

Best regards

Comments

ica1’s picture

ConfigSingleExportForm.php in config module is a good start :
foreach ($this->entityManager->getDefinitions() as $entity_type => $definition) {
if ($definition->entityClassImplements(ConfigEntityInterface::class)) {
$this->definitions[$entity_type] = $definition;
}
}

Call from .module file :

\Drupal::EntityTypeManager()->entityManager->getDefinitions()