function WorkspaceAssociation::deleteAssociations

Same name in other branches
  1. 8.9.x core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\WorkspaceAssociation::deleteAssociations()
  2. 10 core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\WorkspaceAssociation::deleteAssociations()
  3. 11.x core/modules/workspaces/src/WorkspaceAssociation.php \Drupal\workspaces\WorkspaceAssociation::deleteAssociations()

Overrides WorkspaceAssociationInterface::deleteAssociations

1 call to WorkspaceAssociation::deleteAssociations()
WorkspaceAssociation::postPublish in core/modules/workspaces/src/WorkspaceAssociation.php
Triggers clean-up operations after publishing a workspace.

File

core/modules/workspaces/src/WorkspaceAssociation.php, line 217

Class

WorkspaceAssociation
Provides a class for CRUD operations on workspace associations.

Namespace

Drupal\workspaces

Code

public function deleteAssociations($workspace_id, $entity_type_id = NULL, $entity_ids = NULL) {
    $query = $this->database
        ->delete(static::TABLE)
        ->condition('workspace', $workspace_id);
    if ($entity_type_id) {
        $query->condition('target_entity_type_id', $entity_type_id, '=');
        if ($entity_ids) {
            $query->condition('target_entity_id', $entity_ids, 'IN');
        }
    }
    $query->execute();
}

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