if (isset($locales[$locale])) { return $locales[$locale];
} throw new RuntimeException(sprintf('Backend Locale "%s" not supported',
$locale));
} private function setPassword(User
$user, string
$plainPassword): void
{ $passwordEncoderRegistry =
$this->
getContainer()->
get('passwordencoder'
);
$defaultEncoderName =
$passwordEncoderRegistry->
getDefaultPasswordEncoderName();
$encoder =
$passwordEncoderRegistry->
getEncoderByName($defaultEncoderName);
$user->
setPassword($encoder->
encodePassword($plainPassword));
$user->
setEncoder($encoder->
getName());
} /**
* @throws Exception
*/
private function persistUser(User
$user): void
{ $em =
$this->container->
get(ModelManager::
class);