function WorkspaceInformation::isEntitySupported

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

File

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

Class

WorkspaceInformation
General service for workspace support information.

Namespace

Drupal\workspaces

Code

public function isEntitySupported(EntityInterface $entity) : bool {
    $entity_type = $entity->getEntityType();
    if (!$this->isEntityTypeSupported($entity_type)) {
        return FALSE;
    }
    $handler = $this->entityTypeManager
        ->getHandler($entity_type->id(), 'workspace');
    return $handler->isEntitySupported($entity);
}

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