You are here

function workspace_active_id in Workspace 8

Default value callback for 'upstream' base field definition.

Return value

array

File

./workspace.module, line 69

Code

function workspace_active_id() {

  /** @var \Drupal\multiversion\Entity\Workspace $active_workspace */
  $active_workspace = \Drupal::service('workspace.manager')
    ->getActiveWorkspace();
  if ($active_workspace instanceof WorkspaceInterface) {
    return [
      $active_workspace
        ->id(),
    ];
  }
}