function EntityOperations::entityUpdate

Same name in this branch
  1. 11.x core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
Same name and namespace in other branches
  1. 10 core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
  2. 10 core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
  3. 9 core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
  4. 9 core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()
  5. 8.9.x core/modules/content_moderation/src/EntityOperations.php \Drupal\content_moderation\EntityOperations::entityUpdate()
  6. 8.9.x core/modules/workspaces/src/EntityOperations.php \Drupal\workspaces\EntityOperations::entityUpdate()

Implements hook_entity_update().

Attributes

#[Hook('entity_update')]

File

core/modules/workspaces/src/Hook/EntityOperations.php, line 81

Class

EntityOperations
Defines a class for reacting to entity runtime hooks.

Namespace

Drupal\workspaces\Hook

Code

public function entityUpdate(EntityInterface $entity) : void {
  if ($this->workspaceInfo
    ->isEntityIgnored($entity) || !$this->workspaceInfo
    ->isEntitySupported($entity)) {
    return;
  }
  $this->workspaceManager
    ->getActiveWorkspace()?->getProvider()
    ->entityUpdate($entity);
}

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