KMP PHP API Reference

PlatformAuditService
in package

Table of Contents

Properties

$connection  : Connection
$wormFailClosed  : bool|null
$wormSink  : WormAuditSinkInterface|null

Methods

__construct()  : mixed
Constructor.
record()  : array<string, mixed>
Persist a platform audit event and mirror it to the configured immutable sink.
canonicalEventJson()  : string
encodeMetadata()  : string
formatTime()  : string
Format timestamps consistently for the platform database.
lastAuditHash()  : string|null
Return the latest audit hash for platform database hash chaining.
mirror()  : void
Mirror an event to the configured WORM sink.
shouldFailClosed()  : bool
Return whether audit persistence should fail when WORM mirroring fails.

Properties

Methods

record()

Persist a platform audit event and mirror it to the configured immutable sink.

public record(string $action[, string|null $platformUserId = null ][, string|null $subjectType = null ][, string|null $subjectId = null ][, string|null $reason = null ][, array<string, mixed> $metadata = [] ][, bool $withTransaction = true ][, array<string, mixed> $options = [] ]) : array<string, mixed>
Parameters
$action : string
$platformUserId : string|null = null
$subjectType : string|null = null
$subjectId : string|null = null
$reason : string|null = null
$metadata : array<string, mixed> = []
$withTransaction : bool = true
$options : array<string, mixed> = []
Return values
array<string, mixed>

Persisted audit event payload

canonicalEventJson()

private canonicalEventJson(array<string, mixed> $event) : string
Parameters
$event : array<string, mixed>
Return values
string

encodeMetadata()

private encodeMetadata(array<string, mixed> $metadata) : string
Parameters
$metadata : array<string, mixed>
Return values
string

formatTime()

Format timestamps consistently for the platform database.

private formatTime(DateTimeInterface|string $time) : string
Parameters
$time : DateTimeInterface|string
Return values
string

lastAuditHash()

Return the latest audit hash for platform database hash chaining.

private lastAuditHash() : string|null
Return values
string|null

mirror()

Mirror an event to the configured WORM sink.

private mirror(array<string, mixed> $event) : void
Parameters
$event : array<string, mixed>

shouldFailClosed()

Return whether audit persistence should fail when WORM mirroring fails.

private shouldFailClosed() : bool
Return values
bool
On this page

Search results