function WorkspaceSwitchEvent::getPreviousWorkspace

Same name and namespace in other branches
  1. 11.x core/modules/workspaces/src/Event/WorkspaceSwitchEvent.php \Drupal\workspaces\Event\WorkspaceSwitchEvent::getPreviousWorkspace()

Gets the previous active workspace.

Return value

\Drupal\workspaces\WorkspaceInterface|null A workspace entity, or NULL if we switched from Live.

File

core/modules/workspaces/src/Event/WorkspaceSwitchEvent.php, line 34

Class

WorkspaceSwitchEvent
Defines the workspace switch event.

Namespace

Drupal\workspaces\Event

Code

public function getPreviousWorkspace() : ?WorkspaceInterface {
  return $this->previousWorkspace;
}

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