public function onEntityTypeDelete(EntityTypeInterface
$entity_type) { // Nothing to do here.
} /**
* Adds the 'workspace' revision metadata field to an entity type.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type that has been installed or updated.
*/
protected function addRevisionMetadataField(EntityTypeInterface
$entity_type) { if (!
$entity_type->
hasRevisionMetadataKey('workspace'
)) { // Bail out if there's an existing field called 'workspace'.
if ($this->entityDefinitionUpdateManager->
getFieldStorageDefinition('workspace',
$entity_type->
id())) { throw new \
RuntimeException("An existing 'workspace' field was found for the '{
$entity_type->
id()}' entity type. Set the 'workspace' revision metadata key to use a different field name and run this update function again."
);
} // We are only adding a revision metadata key so we don't need to go
// through the entity update process.
$entity_type->
setRevisionMetadataKey('workspace', 'workspace'
);
$this->entityLastInstalledSchemaRepository->
setLastInstalledDefinition($entity_type);
}