diff --git a/core/modules/workspace/src/UpstreamManager.php b/core/modules/workspace/src/UpstreamManager.php index afdbc02f04..201a6557f8 100644 --- a/core/modules/workspace/src/UpstreamManager.php +++ b/core/modules/workspace/src/UpstreamManager.php @@ -13,7 +13,7 @@ class UpstreamManager extends DefaultPluginManager { /** * UpstreamManager constructor. - * + * * @param \Traversable $namespaces * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler diff --git a/core/modules/workspace/src/WorkspaceManager.php b/core/modules/workspace/src/WorkspaceManager.php index ed10159fe4..72543fd689 100644 --- a/core/modules/workspace/src/WorkspaceManager.php +++ b/core/modules/workspace/src/WorkspaceManager.php @@ -118,32 +118,6 @@ public function addNegotiator(WorkspaceNegotiatorInterface $negotiator, $priorit /** * {@inheritdoc} - */ - public function load($workspace_id) { - $workspace = $this->entityTypeManager->getStorage('workspace')->load($workspace_id); - if ($workspace instanceof WorkspaceInterface) { - return $workspace; - } - throw new EntityStorageException("Workspace not found"); - } - - /** - * {@inheritdoc} - */ - public function loadMultiple(array $workspace_ids = NULL) { - return $this->entityTypeManager->getStorage('workspace')->loadMultiple($workspace_ids); - } - - /** - * {@inheritdoc} - */ - public function loadByMachineName($machine_name) { - $workspaces = $this->entityTypeManager->getStorage('workspace')->loadByProperties(['machine_name' => $machine_name]); - return current($workspaces); - } - - /** - * {@inheritdoc} * * @todo {@link https://www.drupal.org/node/2600382 Access check.} */ @@ -153,7 +127,7 @@ public function getActiveWorkspace($object = FALSE) { if ($negotiator->applies($request)) { if ($workspace_id = $negotiator->getWorkspaceId($request)) { if ($object) { - return $this->load($workspace_id); + return $this->entityTypeManager->getStorage('workspace')->load($workspace_id); } else { return $workspace_id; diff --git a/core/modules/workspace/src/WorkspaceManagerInterface.php b/core/modules/workspace/src/WorkspaceManagerInterface.php index 5c408a4a99..fd7fc86956 100644 --- a/core/modules/workspace/src/WorkspaceManagerInterface.php +++ b/core/modules/workspace/src/WorkspaceManagerInterface.php @@ -38,21 +38,6 @@ public function getSupportedEntityTypes(); public function addNegotiator(WorkspaceNegotiatorInterface $negotiator, $priority); /** - * @param int $workspace_id - */ - public function load($workspace_id); - - /** - * @param array|null $workspace_ids - */ - public function loadMultiple(array $workspace_ids = NULL); - - /** - * @param string $machine_name - */ - public function loadByMachineName($machine_name); - - /** * @param bool $object * Should the active workspace be returned as an object. * diff --git a/core/modules/workspace/tests/src/Functional/ReplicationTest.php b/core/modules/workspace/tests/src/Functional/ReplicationTest.php index 3fc26c63b0..4da13555c2 100644 --- a/core/modules/workspace/tests/src/Functional/ReplicationTest.php +++ b/core/modules/workspace/tests/src/Functional/ReplicationTest.php @@ -7,7 +7,7 @@ /** * Class ReplicationTest - * + * * @group workspace */ class ReplicationTest extends BrowserTestBase { diff --git a/core/modules/workspace/tests/src/Functional/WorkspaceEntityTest.php b/core/modules/workspace/tests/src/Functional/WorkspaceEntityTest.php index 946aa39695..6011298b0f 100644 --- a/core/modules/workspace/tests/src/Functional/WorkspaceEntityTest.php +++ b/core/modules/workspace/tests/src/Functional/WorkspaceEntityTest.php @@ -50,7 +50,7 @@ public function testNodeEntity($initial_workspace) { ]; $default = \Drupal::getContainer()->getParameter('workspace.default'); $this->switchToWorkspace($workspaces[$initial_workspace]); - + $workspace_manager = \Drupal::service('workspace.manager'); $this->assertEquals($initial_workspace, $workspace_manager->getActiveWorkspace()); diff --git a/core/modules/workspace/workspace.module b/core/modules/workspace/workspace.module index d3e97bc919..6354b7c67f 100644 --- a/core/modules/workspace/workspace.module +++ b/core/modules/workspace/workspace.module @@ -308,9 +308,7 @@ function workspace_page_bottom(array &$page_bottom) { $workspace_forms = []; /** @var \Drupal\workspace\Entity\WorkspaceInterface $workspace */ - foreach (\Drupal::entityTypeManager() - ->getStorage('workspace') - ->loadMultiple() as $workspace) { + foreach (\Drupal::entityTypeManager()->getStorage('workspace')->loadMultiple() as $workspace) { if ($workspace->id() != $active_workspace->id() && $workspace->access('view', \Drupal::currentUser())) { $workspace_forms['workspace_' . $workspace->getMachineName()] = \Drupal::formBuilder() ->getForm(WorkspaceSwitcherForm::class, $workspace);