asdasd
All checks were successful
Deploy / deploy-staging (push) Successful in 5s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-16 01:35:08 +02:00
parent 9f2af4676d
commit 82ad817ad3
2 changed files with 24 additions and 7 deletions

View File

@@ -74,6 +74,16 @@ final class KeaHostRepository
))));
}
public function countReservations(): int
{
return $this->countTableRows('hosts');
}
public function countLeases(): int
{
return $this->countTableRows('lease4');
}
private function findReservations(int $limit): array
{
if (!$this->tableExists('hosts')) {
@@ -238,6 +248,16 @@ final class KeaHostRepository
return in_array((string)$e->getCode(), ['42P01', '42S02'], true);
}
private function countTableRows(string $table): int
{
if (!$this->tableExists($table)) {
return 0;
}
$stmt = $this->pdo->query('SELECT COUNT(*) FROM ' . $table);
return (int)$stmt->fetchColumn();
}
/**
* Erstellt eine neue Host-Reservierung inkl. Metadaten.
*