3 namespace Drupal\workspaces;
5 use Drupal\Core\Entity\ContentEntityStorageInterface;
6 use Drupal\Core\Entity\EntityInterface;
9 * Defines an interface for workspace association entity storage classes.
11 interface WorkspaceAssociationStorageInterface extends ContentEntityStorageInterface {
14 * Triggers clean-up operations after pushing.
16 * @param \Drupal\workspaces\WorkspaceInterface $workspace
19 public function postPush(WorkspaceInterface $workspace);
22 * Retrieves the content revisions tracked by a given workspace.
24 * @param string $workspace_id
25 * The ID of the workspace.
26 * @param bool $all_revisions
27 * (optional) Whether to return all the tracked revisions for each entity or
28 * just the latest tracked revision. Defaults to FALSE.
31 * Returns a multidimensional array where the first level keys are entity
32 * type IDs and the values are an array of entity IDs keyed by revision IDs.
34 public function getTrackedEntities($workspace_id, $all_revisions = FALSE);
37 * Gets a list of workspace IDs in which an entity is tracked.
39 * @param \Drupal\Core\Entity\EntityInterface $entity
43 * An array of workspace IDs where the given entity is tracked, or an empty
44 * array if it is not tracked anywhere.
46 public function getEntityTrackingWorkspaceIds(EntityInterface $entity);