You are here

public function WorkspaceManager::shouldAlterOperations in Workspace 8.2

Determines whether runtime entity operations should be altered.

Parameters

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

Return value

bool TRUE if the entity operations or queries should be altered in the current request, FALSE otherwise.

Overrides WorkspaceManagerInterface::shouldAlterOperations

File

src/WorkspaceManager.php, line 203

Class

WorkspaceManager
Provides the workspace manager.

Namespace

Drupal\workspace

Code

public function shouldAlterOperations(EntityTypeInterface $entity_type) {
  return $this
    ->isEntityTypeSupported($entity_type) && !$this
    ->getActiveWorkspace()
    ->isDefaultWorkspace();
}