function WorkspacesTestHooks::entityTranslationCreate
Implements hook_ENTITY_TYPE_translation_create() for 'entity_test_mulrevpub'.
Attributes
#[Hook('entity_test_mulrevpub_translation_create')]
File
-
core/
modules/ workspaces/ tests/ modules/ workspaces_test/ src/ Hook/ WorkspacesTestHooks.php, line 38
Class
- WorkspacesTestHooks
- Hook implementations for workspaces_test.
Namespace
Drupal\workspaces_test\HookCode
public function entityTranslationCreate() : void {
/** @var \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager */
$workspace_manager = \Drupal::service('workspaces.manager');
$this->keyValueFactory
->get('ws_test')
->set('workspace_was_active', $workspace_manager->hasActiveWorkspace());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.