getDoctrine()->getManager(); $pdo_options[ \PDO::ATTR_ERRMODE ] = \PDO::ERRMODE_EXCEPTION; $bdd = new \PDO( 'mysql:host=localhost;dbname=framadate', 'useur', 'le_pass', $pdo_options ); $reponse = $bdd->query( 'SELECT * FROM les_sondages ORDER BY id ASC LIMIT 0, 450' ); //boucler pour ranger while ( $d = $reponse->fetch( \PDO::FETCH_OBJ ) ) { $u = new Poll(); if ( $d->pseudo == 'PSEUDOOOOOO' ) { $d->pseudo = ""; } // $u->setPseudo($d->pseudo) // ->setIp($d->ip) // ->setAge($d->age) // ->setsondage($s); $em->persist( $s ); } $em->flush(); // gather objects // create new polls // success // failure notice return $this->json( [ "message" => "welcome to the framadate migration endpoint, it has yet to be done", "debug" => $debug, ], 200 ); } }