KMP PHP API Reference

BackupRetentionService
in package

FinalYes

Deletes expired encrypted objects while retaining non-sensitive metadata.

Table of Contents

Properties

$deletion  : BackupDeletionService
$legacyStorage  : BackupArchiveStorageInterface
$platform  : Connection
$platformStorage  : PlatformDatabaseBackupStorageInterface
$tenantStorage  : TenantBackupStorageInterface

Methods

__construct()  : mixed
Constructor.
prune()  : array{tenant_expired: int, platform_expired: int, failed: int}
archiveRemovalCompletedConcurrently()  : bool
Treat another process completing removal after candidate selection as success.
expiredPlatformBackups()  : array<int, array<string, mixed>>
expiredTenantBackups()  : array<int, array<string, mixed>>
markRetentionFailure()  : void
Persist a sanitized cleanup failure for a later retry.
storageFor()  : BackupArchiveStorageInterface
timestamp()  : string
Normalize the retention cutoff to UTC database format.

Properties

Methods

__construct()

Constructor.

public __construct(Connection $platform, TenantBackupStorageInterface $tenantStorage, PlatformDatabaseBackupStorageInterface $platformStorage, BackupArchiveStorageInterface $legacyStorage, PlatformAuditService $audit) : mixed
Parameters
$platform : Connection
$tenantStorage : TenantBackupStorageInterface
$platformStorage : PlatformDatabaseBackupStorageInterface
$legacyStorage : BackupArchiveStorageInterface
$audit : PlatformAuditService

prune()

public prune([DateTimeInterface|string|null $now = null ][, int $limit = 200 ]) : array{tenant_expired: int, platform_expired: int, failed: int}
Parameters
$now : DateTimeInterface|string|null = null
$limit : int = 200
Return values
array{tenant_expired: int, platform_expired: int, failed: int}

archiveRemovalCompletedConcurrently()

Treat another process completing removal after candidate selection as success.

private archiveRemovalCompletedConcurrently(string $table, array<string, mixed> $backup, Throwable $exception) : bool
Parameters
$table : string
$backup : array<string, mixed>
$exception : Throwable
Return values
bool

expiredPlatformBackups()

private expiredPlatformBackups(string $now, int $limit) : array<int, array<string, mixed>>
Parameters
$now : string
$limit : int
Return values
array<int, array<string, mixed>>

expiredTenantBackups()

private expiredTenantBackups(string $now, int $limit) : array<int, array<string, mixed>>
Parameters
$now : string
$limit : int
Return values
array<int, array<string, mixed>>

markRetentionFailure()

Persist a sanitized cleanup failure for a later retry.

private markRetentionFailure(string $table, array<string, mixed> $backup, Throwable $exception, string $now) : void
Parameters
$table : string
$backup : array<string, mixed>
$exception : Throwable
$now : string

timestamp()

Normalize the retention cutoff to UTC database format.

private timestamp(DateTimeInterface|string|null $value) : string
Parameters
$value : DateTimeInterface|string|null
Return values
string
On this page

Search results