Test relations for bibliography
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user