Other various changes

This commit is contained in:
2025-04-04 15:27:16 -04:00
parent 6af5f2a3f8
commit f114843e4c
20 changed files with 231 additions and 190 deletions

View File

@@ -25,6 +25,35 @@ class ReferenceRepository extends ServiceEntityRepository
->getResult();
}
public function findHeidelberg($ref): array|Reference
{
if (substr($ref, 0, 2) == 'ld') {
$num = substr($ref, 2);
$qb = $this->createQueryBuilder('r');
$r = $qb->where($qb->expr()->like('r.label', ':ld'))
->setParameter('ld', "ld{$num}-%")
->getQuery()
->getResult()
;
} elseif (substr($ref, 0, 2) == 'hc') {
$num = substr($ref, 2);
$qb = $this->createQueryBuilder('r');
$r = $qb->where($qb->expr()->like('r.label', ':hc'))
->setParameter('hc', "%-hc{$num}")
->getQuery()
->getResult()
;
if(count($r) > 0) {
$r = $r[0];
$r->setLabel(implode("\n", explode("-", $r->getLabel())));
}
}
return $r;
}
// /**
// * @return Reference[] Returns an array of Reference objects
// */