Add collection and new vocab + mess with repository

This commit is contained in:
2024-11-04 17:16:16 +01:00
parent f8e470b096
commit 0a41ff4a7b
28 changed files with 2599 additions and 38 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Controller;
use App\Entity\Collection;
use App\Entity\Bibliography;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class CollectionController extends AbstractController
{
#[Route('/collection/{id<\d+>}', name: 'app_collection')]
public function index(Collection $collection, EntityManagerInterface $em): Response
{
$bibliographies = $em->getRepository(Bibliography::class)->findAllCollection($collection->getId());
$collection->setBibliographies($bibliographies);
return $this->render('collection/index.html.twig', [
'controller_name' => 'CollectionController',
'record' => $collection,
]);
}
}