if ($field_definition->getName() === $this->entityType->getKey('id')) {
// String IDs can be set when creating the entity.
if (!($entity->isNew() && $field_definition->getType() === 'string')) {
if ($field_definition->getName() === $this->entityType->getKey('id')) {
// String IDs can be set when creating the entity.
if (!($entity->isNew() && $field_definition->getType() === 'string')) {