function WorkspaceProviderCollector::getProvider

Gets the workspace provider for the given ID.

Parameters

string $id: A workspace provider ID.

Return value

\Drupal\workspaces\Provider\WorkspaceProviderInterface The workspace provider.

File

core/modules/workspaces/src/Provider/WorkspaceProviderCollector.php, line 32

Class

WorkspaceProviderCollector
Defines the workspace provider collector.

Namespace

Drupal\workspaces\Provider

Code

public function getProvider($id) : WorkspaceProviderInterface {
  if (!isset($this->providers[$id])) {
    throw new \DomainException("Workspace provider '{$id}' not found.");
  }
  return $this->providers[$id];
}

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