You are here

public function ConfigLister::listTypes in Configuration Update Manager 8

Sets up and returns the entity definitions list.

Overrides ConfigListInterface::listTypes

4 calls to ConfigLister::listTypes()
ConfigLister::getType in src/ConfigLister.php
Returns the entity type object for a given config type name.
ConfigLister::getTypeByPrefix in src/ConfigLister.php
Returns the entity type object for a given config prefix.
ConfigLister::getTypeNameByConfigName in src/ConfigLister.php
Returns the config type name for a given config object.
ConfigLister::listConfig in src/ConfigLister.php
Lists the config objects in active and extension storage.

File

src/ConfigLister.php, line 84

Class

ConfigLister
Provides methods related to config listing.

Namespace

Drupal\config_update

Code

public function listTypes() {

  // Return list if it has already been calculated.
  if (count($this->definitions)) {
    return $this->definitions;
  }

  // Calculate and return the list.
  foreach ($this->entityManager
    ->getDefinitions() as $entity_type => $definition) {
    if ($definition
      ->entityClassImplements('Drupal\\Core\\Config\\Entity\\ConfigEntityInterface')) {
      $this->definitions[$entity_type] = $definition;
      $prefix = $definition
        ->getConfigPrefix();
      $this->typesByPrefix[$prefix] = $entity_type;
    }
  }
  ksort($this->definitions);
  return $this->definitions;
}