WorkspaceAssociation
class WorkspaceAssociation implements WorkspaceAssociationInterface (View source)
Provides a class for CRUD operations on workspace associations.
Constants
| TABLE |
The table for the workspace association storage. |
Properties
| protected Connection | $database | The database connection. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected WorkspaceRepositoryInterface | $workspaceRepository | The workspace repository service. |
Methods
Constructs a WorkspaceAssociation object.
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
__construct(Connection $connection, EntityTypeManagerInterface $entity_type_manager, WorkspaceRepositoryInterface $workspace_repository)
Constructs a WorkspaceAssociation object.
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.