interface WorkspaceRepositoryInterface

Same name in other branches
  1. 9 core/modules/workspaces/src/WorkspaceRepositoryInterface.php \Drupal\workspaces\WorkspaceRepositoryInterface
  2. 10 core/modules/workspaces/src/WorkspaceRepositoryInterface.php \Drupal\workspaces\WorkspaceRepositoryInterface
  3. 11.x core/modules/workspaces/src/WorkspaceRepositoryInterface.php \Drupal\workspaces\WorkspaceRepositoryInterface

Provides an interface for workspace tree lookup operations.

Hierarchy

Expanded class hierarchy of WorkspaceRepositoryInterface

All classes that implement WorkspaceRepositoryInterface

2 files declare their use of WorkspaceRepositoryInterface
EntityWorkspaceConflictConstraintValidator.php in core/modules/workspaces/src/Plugin/Validation/Constraint/EntityWorkspaceConflictConstraintValidator.php
WorkspaceDeleteForm.php in core/modules/workspaces/src/Form/WorkspaceDeleteForm.php

File

core/modules/workspaces/src/WorkspaceRepositoryInterface.php, line 8

Namespace

Drupal\workspaces
View source
interface WorkspaceRepositoryInterface {
    
    /**
     * Returns an array of workspaces tree item properties, sorted in tree order.
     *
     * @return array
     *   An array of workspace tree item properties, keyed by the workspace IDs.
     *   The tree item properties are:
     *   - depth: The depth of the workspace in the tree;
     *   - ancestors: The ancestor IDs of the workspace;
     *   - descendants: The descendant IDs of the workspace.
     */
    public function loadTree();
    
    /**
     * Returns the descendant IDs of the passed-in workspace, including itself.
     *
     * @param string $workspace_id
     *   A workspace ID.
     *
     * @return string[]
     *   An array of descendant workspace IDs, including the passed-in one.
     */
    public function getDescendantsAndSelf($workspace_id);
    
    /**
     * Resets the cached workspace tree.
     *
     * @return $this
     */
    public function resetCache();

}

Members

Title Sort descending Modifiers Object type Summary Overrides
WorkspaceRepositoryInterface::getDescendantsAndSelf public function Returns the descendant IDs of the passed-in workspace, including itself. 1
WorkspaceRepositoryInterface::loadTree public function Returns an array of workspaces tree item properties, sorted in tree order. 1
WorkspaceRepositoryInterface::resetCache public function Resets the cached workspace tree. 1

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