You are here

public function WorkspaceManager::getSupportedEntityTypes in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workspaces/src/WorkspaceManager.php \Drupal\workspaces\WorkspaceManager::getSupportedEntityTypes()

Returns an array of entity types that can belong to workspaces.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The entity types what can belong to workspaces.

Overrides WorkspaceManagerInterface::getSupportedEntityTypes

1 call to WorkspaceManager::getSupportedEntityTypes()
WorkspaceManager::doSwitchWorkspace in core/modules/workspaces/src/WorkspaceManager.php
Switches the current workspace.

File

core/modules/workspaces/src/WorkspaceManager.php, line 153

Class

WorkspaceManager
Provides the workspace manager.

Namespace

Drupal\workspaces

Code

public function getSupportedEntityTypes() {
  $entity_types = [];
  foreach ($this->entityTypeManager
    ->getDefinitions() as $entity_type_id => $entity_type) {
    if ($this
      ->isEntityTypeSupported($entity_type)) {
      $entity_types[$entity_type_id] = $entity_type;
    }
  }
  return $entity_types;
}