function WorkspaceAssociationInterface::moveTrackedEntities

Moves tracked entities from one workspace to another.

Parameters

string $source_workspace_id: The ID of the source workspace.

string $target_workspace_id: The ID of the target workspace.

string|null $entity_type_id: (optional) The entity type ID to filter the move operation. If NULL, all entity types will be moved. Defaults to NULL.

int[]|string[]|null $entity_ids: (optional) An array of entity IDs to move. If NULL, all entities of the specified type (or all entities if no type specified) will be moved. Defaults to NULL.

Throws

\InvalidArgumentException If the source and target workspace IDs are the same, or if entity IDs are provided without an entity type ID.

\DomainException If either workspace is not top-level or has sub-workspaces.

1 method overrides WorkspaceAssociationInterface::moveTrackedEntities()
WorkspaceAssociation::moveTrackedEntities in core/modules/workspaces/src/WorkspaceAssociation.php
Moves tracked entities from one workspace to another.

File

core/modules/workspaces/src/WorkspaceAssociationInterface.php, line 148

Class

WorkspaceAssociationInterface
Defines an interface for the workspace_association service.

Namespace

Drupal\workspaces

Code

public function moveTrackedEntities(string $source_workspace_id, string $target_workspace_id, ?string $entity_type_id = NULL, ?array $entity_ids = NULL) : void;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.