diff --git a/src/Import.php b/src/Import.php index ff6573e..44ae8a9 100644 --- a/src/Import.php +++ b/src/Import.php @@ -517,6 +517,12 @@ private function importUsers(array $data): void $user->setBackendTheme($importUser->get('backendTheme', 'default')); $user->setStatus($importUser->get('status', ($importUser->get('enabled') ? 'enabled' : 'disabled'))); + // Override @GeneratedValue strategy + $metadata = $this->em->getClassMetadata(get_class($user)); + $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE); + $metadata->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator()); + $user->setId($importUser->get('id')); + $this->em->persist($user); $this->em->flush();