You are here

public function WorkspaceManager::isEntityTypeSupported in Workspace 8.2

Returns whether an entity type can belong to a workspace or not.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to check.

Return value

bool TRUE if the entity type can belong to a workspace, FALSE otherwise.

Overrides WorkspaceManagerInterface::isEntityTypeSupported

2 calls to WorkspaceManager::isEntityTypeSupported()
WorkspaceManager::getSupportedEntityTypes in src/WorkspaceManager.php
Returns an array of entity types that can belong to workspaces.
WorkspaceManager::shouldAlterOperations in src/WorkspaceManager.php
Determines whether runtime entity operations should be altered.

File

src/WorkspaceManager.php, line 123

Class

WorkspaceManager
Provides the workspace manager.

Namespace

Drupal\workspace

Code

public function isEntityTypeSupported(EntityTypeInterface $entity_type) {
  if (!isset($this->blacklist[$entity_type
    ->id()]) && $entity_type
    ->entityClassImplements(EntityPublishedInterface::class) && $entity_type
    ->isRevisionable()) {
    return TRUE;
  }
  $this->blacklist[$entity_type
    ->id()] = $entity_type
    ->id();
  return FALSE;
}