PlatformBackupPolicyService
in package
Reads and writes the single global backup policy (cadence + retention).
The policy is the one source of truth for how often managed tenant backups are taken, how long they are retained, and — derived from the cadence — when fleet health should flag a tenant's backups as stale.
Table of Contents
Constants
- CADENCE_DAILY : mixed = 'daily'
- CADENCE_WEEKLY : mixed = 'weekly'
- FLEET_SCHEDULE_NAME : mixed = 'tenant-backup-fleet'
- SETTING_CADENCE : mixed = 'backup.cadence'
- SETTING_RETENTION_DAYS : mixed = 'backup.retention_days'
Properties
- $platformConnection : Connection
Methods
- __construct() : mixed
- Constructor.
- cadence() : string
- The configured backup cadence: daily or weekly.
- cadenceHours() : int
- The cadence window expressed in hours.
- criticalAfterHours() : int
- Three missed cadence windows is an incident.
- cronExpression() : string
- Cron expression matching the configured cadence.
- retentionDays() : int
- Retention days for new backups, clamped to 1-365.
- save() : void
- Persist the policy and keep the fleet backup schedule's cron in step.
- warningAfterHours() : int
- A tenant's latest backup older than one cadence window deserves attention.
- read() : string|null
- Read one policy setting value.
- write() : void
- Upsert one policy setting value.
Constants
CADENCE_DAILY
public
mixed
CADENCE_DAILY
= 'daily'
CADENCE_WEEKLY
public
mixed
CADENCE_WEEKLY
= 'weekly'
FLEET_SCHEDULE_NAME
public
mixed
FLEET_SCHEDULE_NAME
= 'tenant-backup-fleet'
SETTING_CADENCE
public
mixed
SETTING_CADENCE
= 'backup.cadence'
SETTING_RETENTION_DAYS
public
mixed
SETTING_RETENTION_DAYS
= 'backup.retention_days'
Properties
$platformConnection read-only
private
Connection
$platformConnection
Methods
__construct()
Constructor.
public
__construct(Connection $platformConnection) : mixed
Parameters
- $platformConnection : Connection
cadence()
The configured backup cadence: daily or weekly.
public
cadence() : string
Return values
stringcadenceHours()
The cadence window expressed in hours.
public
cadenceHours() : int
Return values
intcriticalAfterHours()
Three missed cadence windows is an incident.
public
criticalAfterHours() : int
Return values
intcronExpression()
Cron expression matching the configured cadence.
public
cronExpression() : string
Return values
stringretentionDays()
Retention days for new backups, clamped to 1-365.
public
retentionDays() : int
Return values
intsave()
Persist the policy and keep the fleet backup schedule's cron in step.
public
save(string $cadence, int $retentionDays) : void
Parameters
- $cadence : string
- $retentionDays : int
warningAfterHours()
A tenant's latest backup older than one cadence window deserves attention.
public
warningAfterHours() : int
Return values
intread()
Read one policy setting value.
private
read(string $key) : string|null
Parameters
- $key : string
Return values
string|nullwrite()
Upsert one policy setting value.
private
write(Connection $connection, string $key, string $value, DateTime $now) : void
Parameters
- $connection : Connection
- $key : string
- $value : string
- $now : DateTime