function WorkspaceListBuilder::load

Same name in other branches
  1. 9 core/modules/workspaces/src/WorkspaceListBuilder.php \Drupal\workspaces\WorkspaceListBuilder::load()
  2. 8.9.x core/modules/workspaces/src/WorkspaceListBuilder.php \Drupal\workspaces\WorkspaceListBuilder::load()
  3. 11.x core/modules/workspaces/src/WorkspaceListBuilder.php \Drupal\workspaces\WorkspaceListBuilder::load()

Overrides EntityListBuilder::load

File

core/modules/workspaces/src/WorkspaceListBuilder.php, line 83

Class

WorkspaceListBuilder
Defines a class to build a listing of workspace entities.

Namespace

Drupal\workspaces

Code

public function load() {
    // Get all the workspace entities and sort them in tree order.
    $workspace_tree = $this->workspaceRepository
        ->loadTree();
    $entities = array_replace($workspace_tree, $this->storage
        ->loadMultiple());
    foreach ($entities as $id => $entity) {
        $entity->_depth = $workspace_tree[$id]['depth'];
    }
    return $entities;
}

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