Add landing for collection + bidirectional many-to-many (biblio-coll)
This commit is contained in:
@@ -24,4 +24,20 @@ class CollectionController extends AbstractController
|
||||
'record' => $collection,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/collection', name: 'app_collection_landing')]
|
||||
public function landing(EntityManagerInterface $em): Response
|
||||
{
|
||||
$repo = $em->getRepository(Collection::class);
|
||||
$records = $repo->findBy([], ['modifiedAt' => 'DESC']);
|
||||
$count = count($records);
|
||||
|
||||
$records = array_slice($records, 0, 15);
|
||||
|
||||
return $this->render('collection/landing.html.twig', [
|
||||
'controller_name' => 'CollectionController',
|
||||
'records' => $records,
|
||||
'count' => $count,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class Bibliography
|
||||
#[ORM\JoinTable(name: 'rel_riferimento_collezione')]
|
||||
#[ORM\JoinColumn(name: 'Bibliografia_id_bib', referencedColumnName: 'id')]
|
||||
#[ORM\InverseJoinColumn(name: 'Collezione_id_coll', referencedColumnName: 'id')]
|
||||
#[ORM\ManyToMany(targetEntity: Collection::class)]
|
||||
#[ORM\ManyToMany(targetEntity: Collection::class, inversedBy: 'bibliography')]
|
||||
private DoctrineCollection $collections;
|
||||
|
||||
private DoctrineCollection $documents;
|
||||
|
||||
Reference in New Issue
Block a user