This commit is contained in:
Jeremy Benoist
2022-11-23 15:51:33 +01:00
parent af6363bbbd
commit b7dba18cb2
41 changed files with 285 additions and 950 deletions

View File

@ -43,7 +43,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
return 1;
}
} else {
$users = $this->getDoctrine()->getRepository(User::class)->findAll();
$users = $this->getContainer()->get('doctrine')->getRepository(User::class)->findAll();
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
@ -60,7 +60,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
private function generateHashedUrls(User $user)
{
$em = $this->getContainer()->get(EntityManagerInterface::class);
$repo = $this->getDoctrine()->getRepository(Entry::class);
$repo = $this->getContainer()->get('doctrine')->getRepository(Entry::class);
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
@ -89,7 +89,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
*/
private function getUser($username)
{
return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
return $this->getContainer()->get('doctrine')->getRepository(User::class)->findOneByUserName($username);
}
private function getDoctrine()