Retrieve ordered results

This commit is contained in:
2025-06-06 13:53:42 +02:00
parent 7ab75a30fb
commit 321a6a4bea
6 changed files with 91 additions and 57 deletions

View File

@@ -17,7 +17,7 @@ class FindingController extends AbstractController
{
$repo = $em->getRepository(Finding::class);
$findings = $repo->findAll();
$findings = $repo->findBy([], ['label' => 'ASC']);
foreach($findings as $key => $finding) {
$coords = $repo->coordinates($finding->getId());

View File

@@ -20,7 +20,7 @@ class NotConservedController extends AbstractController
//$repoBib = $em->getRepository(Bibliography::class);
$repoImg = $em->getRepository(Image::class);
$records = $repo->findBy([], ['id' => 'ASC']);
$records = $repo->findBy([], ['label' => 'ASC']);
// Terrible? N+1..
foreach ($records as $key => $record) {

View File

@@ -18,7 +18,7 @@ class PrehistoricController extends AbstractController
$repo = $em->getRepository(Prehistoric::class);
//$repoBib = $em->getRepository(Bibliography::class);
$records = $repo->findBy([], ['id' => 'ASC']);
$records = $repo->findBy([], ['label' => 'ASC']);
// Terrible? N+1..
foreach ($records as $key => $record) {

View File

@@ -20,7 +20,7 @@ class SiteController extends AbstractController
{
$repo = $em->getRepository(Site::class);
$sites = $repo->findAll();
$sites = $repo->findBy([], ['label' => 'ASC']);
// TODO N+1...
foreach($sites as $key => $site) {