function WorkspaceInformation::getSupportedEntityTypes

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

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

Return value

\Drupal\Core\Entity\EntityTypeInterface[] An array of entity type definition objects.

Overrides WorkspaceInformationInterface::getSupportedEntityTypes

File

core/modules/workspaces/src/WorkspaceInformation.php, line 72

Class

WorkspaceInformation
General service for workspace support information.

Namespace

Drupal\workspaces

Code

public function getSupportedEntityTypes() : array {
  $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.