You are here

protected function Tables::addNextBaseTable in Drupal 10

Same name in this branch
  1. 10 core/modules/workspaces/src/EntityQuery/Tables.php \Drupal\workspaces\EntityQuery\Tables::addNextBaseTable()
  2. 10 core/lib/Drupal/Core/Entity/Query/Sql/Tables.php \Drupal\Core\Entity\Query\Sql\Tables::addNextBaseTable()
Same name and namespace in other branches
  1. 8 core/modules/workspaces/src/EntityQuery/Tables.php \Drupal\workspaces\EntityQuery\Tables::addNextBaseTable()
  2. 9 core/modules/workspaces/src/EntityQuery/Tables.php \Drupal\workspaces\EntityQuery\Tables::addNextBaseTable()

File

core/modules/workspaces/src/EntityQuery/Tables.php, line 116

Class

Tables
Alters entity queries to use a workspace revision instead of the default one.

Namespace

Drupal\workspaces\EntityQuery

Code

protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column, FieldStorageDefinitionInterface $field_storage) {
  $next_base_table_alias = parent::addNextBaseTable($entity_type, $table, $sql_column, $field_storage);
  $active_workspace_id = $this->sqlQuery
    ->getMetaData('active_workspace_id');
  if ($active_workspace_id && $this->workspaceManager
    ->isEntityTypeSupported($entity_type)) {
    $this
      ->addWorkspaceAssociationJoin($entity_type
      ->id(), $next_base_table_alias, $active_workspace_id);
  }
  return $next_base_table_alias;
}