getRepository(GpuCore::class) ->findBy([], [ 'brand' => 'asc', 'architecture' => 'asc', 'name' => 'asc', 'variant' => 'asc', ]); return $this->render('gpu_core/index.html.twig', [ 'gpu_cores' => $gPUCores, ]); } #[Route('/new', name: 'gpu-core_new', methods: ['GET', 'POST'])] public function new(Request $request, EntityManagerInterface $entityManager): Response { $gPUCore = new GpuCore(); $form = $this->createForm(GPUCoreType::class, $gPUCore); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $entityManager->persist($gPUCore); $entityManager->flush(); return $this->redirectToRoute('gpu-core_index', [], Response::HTTP_SEE_OTHER); } return $this->renderForm('gpu_core/new.html.twig', [ 'gpu_core' => $gPUCore, 'form' => $form, ]); } #[Route('/{id}', name: 'gpu-core_show', methods: ['GET'])] public function show(GpuCore $gPUCore): Response { return $this->render('gpu_core/show.html.twig', [ 'gpu_core' => $gPUCore, ]); } #[Route('/{id}/edit', name: 'gpu-core_edit', methods: ['GET', 'POST'])] public function edit(Request $request, GpuCore $gPUCore, EntityManagerInterface $entityManager): Response { $form = $this->createForm(GPUCoreType::class, $gPUCore); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $entityManager->flush(); return $this->redirectToRoute('gpu-core_index', [], Response::HTTP_SEE_OTHER); } return $this->renderForm('gpu_core/edit.html.twig', [ 'gpu_core' => $gPUCore, 'form' => $form, ]); } #[Route('/{id}', name: 'gpu-core_delete', methods: ['POST'])] public function delete(Request $request, GpuCore $gPUCore, EntityManagerInterface $entityManager): Response { if ($this->isCsrfTokenValid('delete'.$gPUCore->getId(), $request->request->get('_token'))) { $entityManager->remove($gPUCore); $entityManager->flush(); } return $this->redirectToRoute('gpu-core_index', [], Response::HTTP_SEE_OTHER); } }