public function list(EntityManagerInterface $entityManager, ItemRepository $itemRepository)
{
$items = $itemRepository->findAll();
// ...
$entityManage->flush();
}
public function list()
{
$entityManager = $this->getDoctrine()->getManager();
$itemRepository = $entityManager->getRepository(Item::class);
$items = $itemRepository->findAll();
// ...
$entityManage->flush();
}
https://github.com/symfony/demo/blob/main/.github/...