You are here

interface ConflictTrackerInterface in Multiversion 8

The interface for services that track conflicts in a workspace.

Hierarchy

Expanded class hierarchy of ConflictTrackerInterface

All classes that implement ConflictTrackerInterface

File

src/Workspace/ConflictTrackerInterface.php, line 9

Namespace

Drupal\multiversion\Workspace
View source
interface ConflictTrackerInterface {

  /**
   * Sets the workspace to be used in subsequent queries.
   *
   * If no workspace is set the default workspace will be used.
   * @see \Drupal\multiversion\Workspace\WorkspaceManagerInterface::getActiveWorkspace().
   *
   * @param \Drupal\multiversion\Entity\WorkspaceInterface $workspace
   *   The id of the workspace.
   * @return \Drupal\multiversion\Workspace\ConflictTrackerInterface
   */
  public function useWorkspace(WorkspaceInterface $workspace);

  /**
   * Adds new conflicts to the tracker.
   *
   * @param string $uuid
   *   The uuid for the entity to track.
   * @param array $revision_conflicts
   *   The revision conflicts to add.
   *      keys - revision uuids
   *      values - revision statuses
   * @param bool $replace
   *   Whether to replace all existing conflicts.
   */
  public function add($uuid, array $revision_conflicts, $replace = FALSE);

  /**
   * Removes a conflict from the tracker.
   *
   * @param $uuid
   *   The uuid for the entity to track.
   * @param $revision_uuid
   */
  public function resolve($uuid, $revision_uuid);

  /**
   * Resolves all conflicts for an entity.
   *
   * @param $uuid
   *   The uuid for the entity for which to resolve conflicts.
   */
  public function resolveAll($uuid);

  /**
   * Gets all the conflicts for a specific UUID.
   *
   * @param $uuid
   *   The uuid for the entity being track.
   *
   * @return array
   *   The revision conflicts for the entity.
   *     keys - revision uuids
   *     values - revision statuses
   */
  public function get($uuid);

  /**
   * Gets all conflicts for entities in the workspace set by useWorkspace.
   *
   * @return array
   *   All of the conflicts for all entities in the workspace.
   *     keys - entity uuids
   *     values - array of conflicts for an entity as return by this::get($uuid).
   */
  public function getAll();

}

Members

Namesort descending Modifiers Type Description Overrides
ConflictTrackerInterface::add public function Adds new conflicts to the tracker. 1
ConflictTrackerInterface::get public function Gets all the conflicts for a specific UUID. 1
ConflictTrackerInterface::getAll public function Gets all conflicts for entities in the workspace set by useWorkspace. 1
ConflictTrackerInterface::resolve public function Removes a conflict from the tracker. 1
ConflictTrackerInterface::resolveAll public function Resolves all conflicts for an entity. 1
ConflictTrackerInterface::useWorkspace public function Sets the workspace to be used in subsequent queries. 1