function EntityOperations::shouldSkipOperations

Same name in other branches
  1. 11.x core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::shouldSkipOperations()

Determines whether we need to react on entity operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check.

Return value

bool Returns TRUE if entity operations should not be altered, FALSE otherwise.

5 calls to EntityOperations::shouldSkipOperations()
EntityOperations::entityInsert in core/modules/workspaces/src/EntityOperations.php
Responds to the creation of a new entity.
EntityOperations::entityPredelete in core/modules/workspaces/src/EntityOperations.php
Acts on an entity before it is deleted.
EntityOperations::entityPresave in core/modules/workspaces/src/EntityOperations.php
Acts on an entity before it is created or updated.
EntityOperations::entityTranslationInsert in core/modules/workspaces/src/EntityOperations.php
Acts after an entity translation has been added.
EntityOperations::entityUpdate in core/modules/workspaces/src/EntityOperations.php
Responds to updates to an entity.

File

core/modules/workspaces/src/EntityOperations.php, line 353

Class

EntityOperations
Defines a class for reacting to entity events.

Namespace

Drupal\workspaces

Code

protected function shouldSkipOperations(EntityInterface $entity) {
    // We should not react on entity operations when the entity is ignored or
    // when we're not in a workspace context.
    return $this->workspaceInfo
        ->isEntityIgnored($entity) || !$this->workspaceManager
        ->hasActiveWorkspace();
}

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