function Workspace::postSave

Same name and namespace in other branches
  1. 11.x core/modules/workspaces/src/Entity/Workspace.php \Drupal\workspaces\Entity\Workspace::postSave()

Overrides ContentEntityBase::postSave

File

core/modules/workspaces/src/Entity/Workspace.php, line 164

Class

Workspace
The workspace entity class.

Namespace

Drupal\workspaces\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) : void {
  parent::postSave($storage, $update);
  // When a new workspace has been saved, we need to copy all the associations
  // of its parent.
  if (!$update && $this->hasParent()) {
    \Drupal::service('workspaces.tracker')->initializeWorkspace($this);
  }
  \Drupal::service('workspaces.repository')->resetCache();
}

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