chore: add inline documentation

This commit is contained in:
Björn Fromme
2026-03-23 19:22:18 +01:00
parent be43d30cc7
commit 7e686cef6b
3 changed files with 29 additions and 0 deletions
@@ -98,7 +98,9 @@ class TravelSnapshotRepository extends ServiceEntityRepository
int $limit,
): array {
return $this->createQueryBuilder('s')
// dateTo IS NULL: snapshots without a known end date are always considered active.
->where('s.dateTo IS NULL OR s.dateTo >= :dateToThreshold')
// extendedRefreshedAt IS NULL: never-refreshed snapshots rank as oldest.
->andWhere('s.extendedRefreshedAt IS NULL OR s.extendedRefreshedAt < :refreshBefore')
->setParameter('dateToThreshold', $dateToThreshold)
->setParameter('refreshBefore', $refreshBefore)
@@ -116,6 +118,8 @@ class TravelSnapshotRepository extends ServiceEntityRepository
{
return (int) $this->createQueryBuilder('s')
->delete()
// Snapshots with no known end date are excluded from purging as a safety net;
// they must be cleaned up manually if they become stale.
->where('s.dateTo IS NOT NULL')
->andWhere('s.dateTo < :beforeDate')
->setParameter('beforeDate', $beforeDate)