You are here

public static function EntityHandlerPluginManager::getEntityTypes in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/Type/EntityHandlerPluginManager.php \Drupal\cms_content_sync\Plugin\Type\EntityHandlerPluginManager::getEntityTypes()
  2. 2.1.x src/Plugin/Type/EntityHandlerPluginManager.php \Drupal\cms_content_sync\Plugin\Type\EntityHandlerPluginManager::getEntityTypes()

Return a list of all entity types and which are supported.

Return value

array

2 calls to EntityHandlerPluginManager::getEntityTypes()
Compatibility::content in src/Controller/Compatibility.php
EntityReferenceHandlerBase::getReferencedEntityTypesFromFieldDefinition in src/Plugin/EntityReferenceHandlerBase.php

File

src/Plugin/Type/EntityHandlerPluginManager.php, line 264

Class

EntityHandlerPluginManager
Manages discovery and instantiation of entity handler plugins.

Namespace

Drupal\cms_content_sync\Plugin\Type

Code

public static function getEntityTypes() {
  $supported_entity_types = [];
  $entity_types = \Drupal::service('entity_type.bundle.info')
    ->getAllBundleInfo();
  ksort($entity_types);
  foreach ($entity_types as $type_key => $entity_type) {
    if ('cms_content_sync' == substr($type_key, 0, 16)) {
      continue;
    }
    ksort($entity_type);
    foreach ($entity_type as $entity_bundle_name => $entity_bundle) {
      $supported_entity_types[] = EntityHandlerPluginManager::getEntityTypeInfo($type_key, $entity_bundle_name);
    }
  }
  return $supported_entity_types;
}