public function EntityOperations::workspaceInsert in Workspace 8
Hook bridge for hook_workspace_insert()
Parameters
\Drupal\multiversion\Entity\WorkspaceInterface $workspace: The workspace entity that is being created.
See also
File
- src/
EntityOperations.php, line 48
Class
- EntityOperations
- Defines a class for reacting to entity events.
Namespace
Drupal\workspaceCode
public function workspaceInsert(WorkspaceInterface $workspace) {
// Create a new pointer to every Workspace that gets created.
// This is mainly so that we can always backtrack from a Workspace to a
// pointer to provide a consistent API to replicators.
$pointer = $this->entityTypeManager
->getStorage('workspace_pointer')
->create();
$pointer
->setWorkspace($workspace);
$pointer
->save();
}