function Tables::addNextBaseTable

Same name in this branch
  1. 9 core/lib/Drupal/Core/Entity/Query/Sql/Tables.php \Drupal\Core\Entity\Query\Sql\Tables::addNextBaseTable()
Same name and namespace in other branches
  1. 11.x core/modules/workspaces/src/EntityQuery/Tables.php \Drupal\workspaces\EntityQuery\Tables::addNextBaseTable()
  2. 11.x core/lib/Drupal/Core/Entity/Query/Sql/Tables.php \Drupal\Core\Entity\Query\Sql\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;
}

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