function WorkspaceRepository::getDescendantsAndSelf

Same name in other branches
  1. 9 core/modules/workspaces/src/WorkspaceRepository.php \Drupal\workspaces\WorkspaceRepository::getDescendantsAndSelf()
  2. 10 core/modules/workspaces/src/WorkspaceRepository.php \Drupal\workspaces\WorkspaceRepository::getDescendantsAndSelf()
  3. 11.x core/modules/workspaces/src/WorkspaceRepository.php \Drupal\workspaces\WorkspaceRepository::getDescendantsAndSelf()

Overrides WorkspaceRepositoryInterface::getDescendantsAndSelf

File

core/modules/workspaces/src/WorkspaceRepository.php, line 137

Class

WorkspaceRepository
Provides the default workspace tree lookup operations.

Namespace

Drupal\workspaces

Code

public function getDescendantsAndSelf($workspace_id) {
    return array_merge([
        $workspace_id,
    ], $this->loadTree()[$workspace_id]['descendants']);
}

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