You are here

public function AdminToolbarToolsHelper::getBundleableEntitiesList in Admin Toolbar 8.2

Same name and namespace in other branches
  1. 3.x admin_toolbar_tools/src/AdminToolbarToolsHelper.php \Drupal\admin_toolbar_tools\AdminToolbarToolsHelper::getBundleableEntitiesList()

Gets a list of content entities.

Return value

array An array of metadata about content entities.

1 call to AdminToolbarToolsHelper::getBundleableEntitiesList()
AdminToolbarToolsHelper::getRebuildEntityTypes in admin_toolbar_tools/src/AdminToolbarToolsHelper.php
Gets an array of entity types that should trigger a menu rebuild.

File

admin_toolbar_tools/src/AdminToolbarToolsHelper.php, line 35

Class

AdminToolbarToolsHelper
Admin Toolbar Tools helper service.

Namespace

Drupal\admin_toolbar_tools

Code

public function getBundleableEntitiesList() {
  $entity_types = $this->entityTypeManager
    ->getDefinitions();
  $content_entities = [];
  foreach ($entity_types as $key => $entity_type) {
    if ($entity_type
      ->getBundleEntityType() && $entity_type
      ->get('field_ui_base_route') != '') {
      $content_entities[$key] = [
        'content_entity' => $key,
        'content_entity_bundle' => $entity_type
          ->getBundleEntityType(),
      ];
    }
  }
  return $content_entities;
}