14 lines
446 B
PHP
14 lines
446 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
function contentpanel_cleanup_expired_announcements(PDO $pdo, string $today): void
|
|
{
|
|
// Das Enddatum ist einschließlich gültig; ohne Enddatum zählt das Startdatum.
|
|
// Datensätze ohne beide Datumswerte werden nicht als abgelaufen gelöscht.
|
|
$statement = $pdo->prepare(
|
|
'DELETE FROM ansagen WHERE COALESCE(ansage_datum_bis, ansage_datum_von) < ?'
|
|
);
|
|
$statement->execute([$today]);
|
|
}
|