Commit 66e7c033 authored by dj3c1t's avatar dj3c1t

import.previous.version set User id

parent 0862b68e
......@@ -96,6 +96,9 @@ class ImportPreviousVersion {
public function importUsers() {
$this->log("import users");
$em = $this->container->get('doctrine')->getManager();
$metadata = $em->getClassMetaData(get_class(new User()));
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator());
$userRepo = $em->getRepository('Dj3c1tAppBundle:User');
$roleRepo = $em->getRepository('Dj3c1tAppBundle:Role');
$adminRole = $roleRepo->findOneByRole("ROLE_ADMIN");
......@@ -120,6 +123,7 @@ class ImportPreviousVersion {
}
$mw_emails[$mw_user["email"]] = true;
$user = new User();
$user->setId($mw_user["id"]);
$user->setIsActive(true);
$user->setUsername($mw_user["login"]);
$user->setSalt("");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment