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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user