function WorkspaceInformation::isEntityTypeIgnored

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

Determines whether CRUD operations for an entity type are allowed.

CRUD operations for an ignored entity type are allowed in a workspace, but their revisions are not tracked.

Parameters

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

Return value

bool TRUE if CRUD operations of an entity type can safely be done inside a workspace, without impacting the Live site, FALSE otherwise.

Overrides WorkspaceInformationInterface::isEntityTypeIgnored

1 call to WorkspaceInformation::isEntityTypeIgnored()
WorkspaceInformation::isEntityIgnored in core/modules/workspaces/src/WorkspaceInformation.php
Determines whether CRUD operations for an entity are allowed.

File

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

Class

WorkspaceInformation
General service for workspace support information.

Namespace

Drupal\workspaces

Code

public function isEntityTypeIgnored(EntityTypeInterface $entity_type) : bool {
  if (!isset($this->ignored[$entity_type->id()])) {
    $this->ignored[$entity_type->id()] = $entity_type->hasHandlerClass('workspace') && is_a($entity_type->getHandlerClass('workspace'), IgnoredWorkspaceHandler::class, TRUE);
  }
  return $this->ignored[$entity_type->id()];
}

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