function workspaces_entity_insert

Same name and namespace in other branches
  1. 9 core/modules/workspaces/workspaces.module \workspaces_entity_insert()
  2. 8.9.x core/modules/workspaces/workspaces.module \workspaces_entity_insert()
  3. 10 core/modules/workspaces/workspaces.module \workspaces_entity_insert()

Implements hook_entity_insert().

File

core/modules/workspaces/workspaces.module, line 132

Code

function workspaces_entity_insert(EntityInterface $entity) {
    if ($entity->getEntityTypeId() === 'workspace') {
        \Drupal::service('workspaces.association')->workspaceInsert($entity);
        \Drupal::service('workspaces.repository')->resetCache();
    }
    return \Drupal::service('class_resolver')->getInstanceFromDefinition(EntityOperations::class)
        ->entityInsert($entity);
}

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