function 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 163

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.