You are here

function workspaces_entity_update in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workspaces/workspaces.module \workspaces_entity_update()
  2. 10 core/modules/workspaces/workspaces.module \workspaces_entity_update()

Implements hook_entity_update().

File

core/modules/workspaces/workspaces.module, line 123
Provides full-site preview functionality for content staging.

Code

function workspaces_entity_update(EntityInterface $entity) {
  if ($entity
    ->getEntityTypeId() === 'workspace') {
    \Drupal::service('workspaces.repository')
      ->resetCache();
  }
  return \Drupal::service('class_resolver')
    ->getInstanceFromDefinition(EntityOperations::class)
    ->entityUpdate($entity);
}