function WorkspaceSafeFormTrait::getWorkspaceInfo

Retrieves the workspace information service.

Return value

\Drupal\workspaces\WorkspaceInformationInterface The workspace information service.

File

core/lib/Drupal/Core/Entity/Form/WorkspaceSafeFormTrait.php, line 65

Class

WorkspaceSafeFormTrait
Provides helpers for checking whether objects in forms are workspace-safe.

Namespace

Drupal\Core\Entity\Form

Code

protected function getWorkspaceInfo() : WorkspaceInformationInterface {
    if (!$this->workspaceInfo) {
        $this->workspaceInfo = \Drupal::service('workspaces.information');
    }
    return $this->workspaceInfo;
}

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