function Workspace::getProvider

Gets the provider of this workspace.

Return value

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

Overrides WorkspaceInterface::getProvider

File

core/modules/workspaces/src/Entity/Workspace.php, line 182

Class

Workspace
The workspace entity class.

Namespace

Drupal\workspaces\Entity

Code

public function getProvider() : WorkspaceProviderInterface {
  /** @var \Drupal\workspaces\Provider\WorkspaceProviderCollector $provider_collector */
  $provider_collector = \Drupal::service(WorkspaceProviderCollector::class);
  return $provider_collector->getProvider($this->get('provider')->value);
}

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