} } // JOINs must be in order. i.e, any tables you mention in the ON clause of a
// JOIN must appear prior to that JOIN. Since we're modifying a JOIN in
// place, and adding a new table, we must ensure that the new table appears
// prior to this one. So we recorded at what index we saw that table, and
// then use array_splice() to move the workspace_association table join to
// the correct position.
foreach ($move_workspace_tables as $workspace_association_table =>
$alias) { $this->
moveEntityTable($query,
$workspace_association_table,
$alias);
} $base_entity_table =
$entity_type->
isTranslatable() ?
$entity_type->
getDataTable() :
$entity_type->
getBaseTable();
$base_fields =
array_diff($table_mapping->
getFieldNames($entity_type->
getBaseTable()),
[$entity_type->
getKey('langcode'
)]);
$revisionable_fields =
array_diff($table_mapping->
getFieldNames($entity_type->
getRevisionDataTable()),
$base_fields);
// Go through and look to see if we have to modify fields and filters.
foreach ($query->fields
as &
$field_info) { // Some fields don't actually have tables, meaning they're formulae and
// whatnot. At this time we are going to ignore those.