I\'m trying to pre-populate a database with some User objects, but when I call $user->setPassword(\'some-password\'); and then save the user object, the stri
$user->setPassword(\'some-password\');
Four lines of code and you are done. It will handle everything for you:
$userManager = $this->container->get('fos_user.user_manager'); $user->setPlainPassword($password); $userManager->updatePassword($user);