Skip to content
Corex

RetentionSettings

Corex\Config\Retention\RetentionSettings · class · Config layer

Pure rules for submission data retention (spec 065). A retention window of 0 means “keep forever” (retention disabled); any positive number of days enables pruning of submissions older than that. This model owns only the safe, testable decisions — the sanitised window, whether retention is enabled, and the shape of the dry-run preview. It never deletes anything; the boundary does, and only after an explicit preview + confirmation. WordPress-free, so it is unit-testable.

Clamp an arbitrary input to a valid retention window in days (0 = keep forever).

Whether this is a retention action: archive, trash or anonymize.

The retention states an action has nothing left to do for, so a run of it skips records in them. Without this a run is handed the records the previous run already handled, and — a run being bounded by {@see self::MAX_PRUNE} — never reaches the ones behind them.

The dry-run preview model: the window, whether retention is on, and how many submissions are due right now (the count the boundary measured). Never a fabricated number.