KMP PHP API Reference

WaiverFileService
in package

Waiver File Service

Handles file I/O operations for gathering waivers: single and multi-page image-to-PDF conversion, document storage, download, preview, and inline display.

Table of Contents

Properties

$documentService  : DocumentService
$imageToPdfConversionService  : ImageToPdfConversionService
$retentionPolicyService  : RetentionPolicyService

Methods

__construct()  : mixed
Constructor
deleteDocument()  : void
Delete a document by ID.
documentPreviewExists()  : bool
Check if a document preview exists for a waiver.
getDownloadResponse()  : Response|null
Get a document download response for a waiver.
getInlinePdfResponse()  : Response|null
Get an inline PDF response for a waiver.
getPreviewResponse()  : Response|null
Get a preview image response for a waiver.
getRequiredWaiverTypes()  : array<string|int, mixed>
Get required waiver types for a gathering based on selected activities.
getUploadLimits()  : array<string|int, mixed>
Get upload limits from PHP configuration.
getWaiverStatusSummary()  : array<string|int, mixed>
Build a summary of existing waiver uploads and attestations for a gathering.
isWaiverTypeAttested()  : bool
Check if a waiver type has been attested as not needed for a gathering.
processMultipleWaiverImages()  : ServiceResult
Process multiple waiver images into a single multi-page PDF.
processWaiverUpload()  : ServiceResult
Process a single waiver image upload into a PDF.
formatBytes()  : string
Format bytes to human-readable size.
parsePhpSize()  : int
Parse PHP size notation to bytes.

Properties

Methods

deleteDocument()

Delete a document by ID.

public deleteDocument(int $documentId) : void
Parameters
$documentId : int

Document ID

documentPreviewExists()

Check if a document preview exists for a waiver.

public documentPreviewExists(mixed $document) : bool
Parameters
$document : mixed

Document entity

Return values
bool

getDownloadResponse()

Get a document download response for a waiver.

public getDownloadResponse(int $waiverId) : Response|null
Parameters
$waiverId : int

Waiver ID

Tags
throws
NotFoundException
Return values
Response|null

getInlinePdfResponse()

Get an inline PDF response for a waiver.

public getInlinePdfResponse(int $waiverId) : Response|null
Parameters
$waiverId : int

Waiver ID

Return values
Response|null

getPreviewResponse()

Get a preview image response for a waiver.

public getPreviewResponse(int $waiverId) : Response|null
Parameters
$waiverId : int

Waiver ID

Return values
Response|null

getRequiredWaiverTypes()

Get required waiver types for a gathering based on selected activities.

public getRequiredWaiverTypes(mixed $gathering) : array<string|int, mixed>
Parameters
$gathering : mixed

Gathering entity with gathering_activities loaded

Return values
array<string|int, mixed>

Array of waiver type entities

getUploadLimits()

Get upload limits from PHP configuration.

public getUploadLimits() : array<string|int, mixed>
Return values
array<string|int, mixed>

Upload limits with maxFileSize and formatted values

getWaiverStatusSummary()

Build a summary of existing waiver uploads and attestations for a gathering.

public getWaiverStatusSummary(int $gatheringId, array<string|int, mixed> $requiredWaiverTypes) : array<string|int, mixed>
Parameters
$gatheringId : int

Gathering ID

$requiredWaiverTypes : array<string|int, mixed>

Required waiver types

Return values
array<string|int, mixed>

Summary of waiver status per type

isWaiverTypeAttested()

Check if a waiver type has been attested as not needed for a gathering.

public isWaiverTypeAttested(int $gatheringId, int $waiverTypeId) : bool
Parameters
$gatheringId : int

Gathering ID

$waiverTypeId : int

Waiver type ID

Return values
bool

processMultipleWaiverImages()

Process multiple waiver images into a single multi-page PDF.

public processMultipleWaiverImages(array<string|int, mixed> $uploadedFiles, mixed $gathering, mixed $waiverType, string $notes, string|null $clientThumbnail, int $currentUserId) : ServiceResult
Parameters
$uploadedFiles : array<string|int, mixed>

Array of UploadedFileInterface objects

$gathering : mixed

Gathering entity

$waiverType : mixed

WaiverType entity

$notes : string

Notes for the waiver

$clientThumbnail : string|null

Client-generated thumbnail data URL

$currentUserId : int

Current user ID for uploaded_by

Return values
ServiceResult

processWaiverUpload()

Process a single waiver image upload into a PDF.

public processWaiverUpload(UploadedFileInterface $uploadedFile, mixed $gathering, mixed $waiverType, int|null $memberId, string $notes, int $currentUserId) : ServiceResult
Parameters
$uploadedFile : UploadedFileInterface

Uploaded file

$gathering : mixed

Gathering entity

$waiverType : mixed

WaiverType entity

$memberId : int|null

Optional member ID

$notes : string

Optional notes

$currentUserId : int

Current user ID for uploaded_by

Return values
ServiceResult

formatBytes()

Format bytes to human-readable size.

private formatBytes(int $bytes[, int $precision = 2 ]) : string
Parameters
$bytes : int

Size in bytes

$precision : int = 2

Decimal precision

Return values
string

Formatted size string

parsePhpSize()

Parse PHP size notation to bytes.

private parsePhpSize(string $size) : int
Parameters
$size : string

Size string from PHP ini setting

Return values
int

Size in bytes


        
On this page

Search results