function WorkspacesTestHooks::cron
Implements hook_cron().
Attributes
File
-
core/
modules/ workspaces/ tests/ modules/ workspaces_test/ src/ Hook/ WorkspacesTestHooks.php, line 119
Class
- WorkspacesTestHooks
- Hook implementations for workspaces_test.
Namespace
Drupal\workspaces_test\HookCode
public function cron() : void {
// Record the active workspace ID (or FALSE if no workspace is active).
$active_workspace_id = $this->workspaceManager
->getActiveWorkspace()?->id() ?? FALSE;
$this->keyValueFactory
->get('ws_test')
->set('cron_active_workspace', $active_workspace_id);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.