class WorkspaceMerger implements WorkspaceMergerInterface (View source)

internal  
 

Default implementation of the workspace merger.

Properties

protected WorkspaceInterface $sourceWorkspace

The source workspace entity.

protected WorkspaceInterface $targetWorkspace

The target workspace entity.

protected EntityTypeManagerInterface $entityTypeManager

The entity type manager.

protected Connection $database

The database connection.

protected WorkspaceAssociationInterface $workspaceAssociation

The workspace association service.

protected CacheTagsInvalidatorInterface $cacheTagsInvalidator

The cache tag invalidator.

Methods

__construct(EntityTypeManagerInterface $entity_type_manager, Connection $database, WorkspaceAssociationInterface $workspace_association, CacheTagsInvalidatorInterface $cache_tags_invalidator, WorkspaceInterface $source, WorkspaceInterface $target)

Constructs a new WorkspaceMerger.

merge()

Merges the contents of the source workspace into the target workspace.

string
getSourceLabel()

Returns the human-readable label of the source.

string
getTargetLabel()

Returns the human-readable label of the target.

array
checkConflictsOnTarget()

Checks if there are any conflicts between the source and the target.

array
getDifferringRevisionIdsOnTarget()

Gets the revision identifiers for items which have changed on the target.

array
getDifferringRevisionIdsOnSource()

Gets the revision identifiers for items which have changed on the source.

int
getNumberOfChangesOnTarget()

Gets the total number of items which have changed on the target.

int
getNumberOfChangesOnSource()

Gets the total number of items which have changed on the source.

Details

__construct(EntityTypeManagerInterface $entity_type_manager, Connection $database, WorkspaceAssociationInterface $workspace_association, CacheTagsInvalidatorInterface $cache_tags_invalidator, WorkspaceInterface $source, WorkspaceInterface $target)

Constructs a new WorkspaceMerger.

Parameters

EntityTypeManagerInterface $entity_type_manager

The entity type manager.

Connection $database

Database connection.

WorkspaceAssociationInterface $workspace_association

The workspace association service.

CacheTagsInvalidatorInterface $cache_tags_invalidator

The cache tags invalidator service.

WorkspaceInterface $source

The source workspace.

WorkspaceInterface $target

The target workspace.

merge()

Merges the contents of the source workspace into the target workspace.

string getSourceLabel()

Returns the human-readable label of the source.

Return Value

string

The source label.

string getTargetLabel()

Returns the human-readable label of the target.

Return Value

string

The target label.

array checkConflictsOnTarget()

Checks if there are any conflicts between the source and the target.

Return Value

array

Returns an array consisting of the number of conflicts between the source and the target, keyed by the conflict type constant.

array getDifferringRevisionIdsOnTarget()

Gets the revision identifiers for items which have changed on the target.

Return Value

array

A multidimensional array of revision identifiers, keyed by entity type IDs.

array getDifferringRevisionIdsOnSource()

Gets the revision identifiers for items which have changed on the source.

Return Value

array

A multidimensional array of revision identifiers, keyed by entity type IDs.

int getNumberOfChangesOnTarget()

Gets the total number of items which have changed on the target.

This returns the aggregated changes count across all entity types. For example, if two nodes and one taxonomy term have changed on the target, the return value is 3.

Return Value

int

The number of differing revisions.

int getNumberOfChangesOnSource()

Gets the total number of items which have changed on the source.

This returns the aggregated changes count across all entity types. For example, if two nodes and one taxonomy term have changed on the source, the return value is 3.

Return Value

int

The number of differing revisions.