You are here

public function DeployManager::getContentEntityTypes in Default Content Deploy 8

Get all Content Entity Types.

Return value

array Array of available content entity definitions keyed by type ID. [entity_type => \Drupal\Core\Entity\EntityTypeInterface]

File

src/DeployManager.php, line 99

Class

DeployManager

Namespace

Drupal\default_content_deploy

Code

public function getContentEntityTypes() {
  $types = [];
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  foreach ($entity_types as $id => $definition) {
    if ($definition instanceof ContentEntityType) {
      $types[$id] = $definition
        ->getLabel();
    }
  }
  ksort($types);
  return $types;
}