$change_list =
[];
foreach ($this->entityTypeManager->
getDefinitions() as $entity_type_id =>
$entity_type) { $original =
$this->entityLastInstalledSchemaRepository->
getLastInstalledDefinition($entity_type_id);
// @todo Support non-storage-schema-changing definition updates too:
// https://www.drupal.org/node/2336895.
if (!
$original) { $change_list[$entity_type_id]['entity_type'
] =
static::DEFINITION_CREATED;
} else { if ($this->
requiresEntityStorageSchemaChanges($entity_type,
$original)) { $change_list[$entity_type_id]['entity_type'
] =
static::DEFINITION_UPDATED;
} if ($this->entityTypeManager->
getStorage($entity_type_id) instanceof DynamicallyFieldableEntityStorageInterface
) { $field_changes =
[];
$storage_definitions =
$this->entityFieldManager->
getFieldStorageDefinitions($entity_type_id);
$original_storage_definitions =
$this->entityLastInstalledSchemaRepository->
getLastInstalledFieldStorageDefinitions($entity_type_id);
// Detect created field storage definitions.
foreach (array_diff_key($storage_definitions,
$original_storage_definitions) as $field_name =>
$storage_definition) { $field_changes[$field_name] =
static::DEFINITION_CREATED;
}