Test relations for bibliography

This commit is contained in:
2024-11-04 22:08:44 +01:00
parent 0a41ff4a7b
commit a2f518ee15
5 changed files with 33 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Controller;
use App\Entity\Bibliography;
use App\Entity\Collection;
use App\Form\BibliographyType;
//use App\Security\Voter\VocabVoter;
use Doctrine\ORM\EntityManagerInterface;
@@ -17,6 +18,11 @@ class BibliographyController extends AbstractController
#[Route('/bibliography/{id<\d+>}', name: 'app_bibliography')]
public function index(Bibliography $bibliography, EntityManagerInterface $em): Response
{
$repo = $em->getRepository(Collection::class);
$collections = $repo->findAllByBibliography($bibliography->getId());
$bibliography->setCollections($collections);
return $this->render('bibliography/index.html.twig', [
'controller_name' => 'BibliographyController',
'record' => $bibliography,