return $table_mapping->
allowsSharedTableStorage($definition);
});
$key_fields =
array_values(array_filter([$id_key,
$revision_key,
$bundle_key,
$uuid_key,
$langcode_key]));
$all_fields =
array_keys($shared_table_definitions);
$revisionable_fields =
array_keys(array_filter($shared_table_definitions,
function DFieldStorageDefinitionInterface
$definition) { return $definition->
isRevisionable();
}));
// Make sure the key fields come first in the list of fields.
$all_fields =
array_merge($key_fields,
array_diff($all_fields,
$key_fields));
$revision_metadata_fields =
$revisionable ?
array_values($entity_type->
getRevisionMetadataKeys()) :
[];
$revision_metadata_fields =
array_intersect($revision_metadata_fields,
array_keys($storage_definitions));
if (!
$revisionable && !
$translatable) { // The base layout stores all the base field values in the base table.
$table_mapping->
setFieldNames($table_mapping->baseTable,
$all_fields);
} elseif ($revisionable && !
$translatable) { // The revisionable layout stores all the base field values in the base
// table, except for revision metadata fields. Revisionable fields
// denormalized in the base table but also stored in the revision table
// together with the entity ID and the revision ID as identifiers.