function WorkspaceListBuilder::load
Overrides EntityListBuilder::load
File
-
core/
modules/ workspaces/ src/ WorkspaceListBuilder.php, line 85
Class
- WorkspaceListBuilder
- Defines a class to build a listing of workspace entities.
Namespace
Drupal\workspacesCode
public function load() {
// Get all the workspace entities and sort them in tree order.
$workspace_tree = $this->workspaceRepository
->loadTree();
$loaded = $this->storage
->loadMultiple($this->getEntityIds());
// Filter the tree to only include loaded entities, then replaces those tree
// items with the actual loaded entity objects.
$entities = array_replace(array_intersect_key($workspace_tree, $loaded), $loaded);
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.