You are here

function multiversion_workspace_presave in Multiversion 8

Implements hook_ENTITY_TYPE_presave().

File

./multiversion.module, line 294

Code

function multiversion_workspace_presave(EntityInterface $entity) {
  if ($entity
    ->isDefaultWorkspace() && !$entity
    ->isPublished() && $entity->original
    ->isPublished()) {
    throw new Exception('The default workspace cannot be archived.');
  }
}