WorkspaceAssociationInterface
interface WorkspaceAssociationInterface (View source)
| internal |
Defines an interface for the workspace_association service.
The canonical workspace association data is stored in a revision metadata field on each entity revision that is tracked by a workspace.
For the purpose of optimizing workspace-specific queries, the default implementation of this interface defines a custom 'workspace_association' index table which stores only the latest revisions tracked by a workspace.
Methods
Updates or creates the association for a given entity and a workspace.
Retrieves the entities tracked by a given workspace.
Retrieves all content revisions tracked by a given workspace.
Gets a list of workspace IDs in which an entity is tracked.
Triggers clean-up operations after publishing a workspace.
Deletes all the workspace association records for the given workspace.
Initializes a workspace with all the associations of its parent.
Details
trackEntity(RevisionableInterface $entity, WorkspaceInterface $workspace)
Updates or creates the association for a given entity and a workspace.
workspaceInsert(WorkspaceInterface $workspace)
Responds to the creation of a new workspace entity.
array
getTrackedEntities(string $workspace_id, string|null $entity_type_id = NULL, int[]|string[]|null $entity_ids = NULL)
Retrieves the entities tracked by a given workspace.
array
getAssociatedRevisions(string $workspace_id, string $entity_type_id, int[]|string[]|null $entity_ids = NULL)
Retrieves all content revisions tracked by a given workspace.
Since the 'workspace_association' index table only tracks the latest associated revisions, this method retrieves all the tracked revisions by querying the entity type's revision table directly.
string[]
getEntityTrackingWorkspaceIds(RevisionableInterface $entity)
Gets a list of workspace IDs in which an entity is tracked.
postPublish(WorkspaceInterface $workspace)
Triggers clean-up operations after publishing a workspace.
deleteAssociations(string $workspace_id, string|null $entity_type_id = NULL, int[]|string[]|null $entity_ids = NULL)
Deletes all the workspace association records for the given workspace.
initializeWorkspace(WorkspaceInterface $workspace)
Initializes a workspace with all the associations of its parent.