$query->
addTag($this->entityTypeId . '_load_multiple'
);
if ($revision_ids) { $query->
join($this->revisionTable, 'revision', "[revision].[{
$this->idKey
}] = [base].[{
$this->idKey
}] AND [revision].[{
$this->revisionKey
}] IN (:revisionIds[])",
[':revisionIds[]' =>
$revision_ids]);
} elseif ($this->revisionTable
) { $query->
join($this->revisionTable, 'revision', "[revision].[{
$this->revisionKey
}] = [base].[{
$this->revisionKey
}]"
);
} // Add fields from the {entity} table.
$table_mapping =
$this->
getTableMapping();
$entity_fields =
$table_mapping->
getAllColumns($this->baseTable
);
if ($this->revisionTable
) { // Add all fields from the {entity_revision} table.
$entity_revision_fields =
$table_mapping->
getAllColumns($this->revisionTable
);
$entity_revision_fields =
array_combine($entity_revision_fields,
$entity_revision_fields);
// The ID field is provided by entity, so remove it.
unset($entity_revision_fields[$this->idKey
]);
// Remove all fields from the base table that are also fields by the same
// name in the revision table.
$entity_field_keys =
array_flip($entity_fields);