function WorkspaceAssociation::getEntityTrackingWorkspaceIds

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

Overrides WorkspaceAssociationInterface::getEntityTrackingWorkspaceIds

1 call to WorkspaceAssociation::getEntityTrackingWorkspaceIds()
WorkspaceAssociation::trackEntity in core/modules/workspaces/src/WorkspaceAssociation.php
Updates or creates the association for a given entity and a workspace.

File

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

Class

WorkspaceAssociation
Provides a class for CRUD operations on workspace associations.

Namespace

Drupal\workspaces

Code

public function getEntityTrackingWorkspaceIds(RevisionableInterface $entity) {
    $query = $this->database
        ->select(static::TABLE)
        ->fields(static::TABLE, [
        'workspace',
    ])
        ->condition('target_entity_type_id', $entity->getEntityTypeId())
        ->condition('target_entity_id', $entity->id());
    return $query->execute()
        ->fetchCol();
}

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