/**
* {@inheritdoc}
*/
public function merge() { if (!
$this->sourceWorkspace->
hasParent() ||
$this->sourceWorkspace->parent->target_id !=
$this->targetWorkspace->
id()) { throw new \
InvalidArgumentException('The contents of a workspace can only be merged into its parent workspace.'
);
} if ($this->
checkConflictsOnTarget()) { throw new WorkspaceConflictException();
} try { $transaction =
$this->database->
startTransaction();
foreach ($this->
getDifferringRevisionIdsOnSource() as $entity_type_id =>
$revision_difference) { $revisions_on_source =
$this->entityTypeManager->
getStorage($entity_type_id) ->
loadMultipleRevisions(array_keys($revision_difference));
/** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
foreach ($revisions_on_source as $revision) { // Track all the differing revisions from the source workspace in