KMP PHP API Reference

WarrantManagerInterface

Warrant Manager Interface

Defines the contract for managing KMP warrant lifecycle: requests, approvals, and lifecycle management for authorized roles/positions within branches.

Tags
see
DefaultWarrantManager

Default implementation

see
WarrantRequest

Warrant request data structure

see
Warrant

Warrant entity

Table of Contents

Methods

approve()  : ServiceResult
Approve a warrant roster and activate all contained warrants.
cancel()  : ServiceResult
Cancel/revoke a specific warrant by ID.
cancelByEntity()  : ServiceResult
Cancel all warrants associated with a specific entity.
decline()  : ServiceResult
Decline an entire warrant roster and cancel all contained warrants.
declineSingleWarrant()  : ServiceResult
Decline a single warrant within a roster.
getWarrantPeriod()  : WarrantPeriod|null
Find or create a warrant period covering the specified date range.
request()  : ServiceResult
Submit a batch of warrant requests for approval.

Methods

approve()

Approve a warrant roster and activate all contained warrants.

public approve(int $warrant_roster_id, int $approver_id) : ServiceResult
Parameters
$warrant_roster_id : int

ID of the WarrantRoster to approve

$approver_id : int

ID of the member providing approval

Return values
ServiceResult

Success if approval recorded, failure with errors

cancel()

Cancel/revoke a specific warrant by ID.

public cancel(int $warrant_id, string $reason, int $rejecter_id, DateTime $expiresOn) : ServiceResult
Parameters
$warrant_id : int

ID of the warrant to cancel

$reason : string

Explanation for cancellation

$rejecter_id : int

ID of member cancelling

$expiresOn : DateTime

When warrant should terminate

Return values
ServiceResult

Always returns success

cancelByEntity()

Cancel all warrants associated with a specific entity.

public cancelByEntity(string $entityType, int $entityId, string $reason, int $rejecter_id, DateTime $expiresOn) : ServiceResult
Parameters
$entityType : string

Entity type (e.g., 'Branches', 'Activities')

$entityId : int

ID of the entity instance

$reason : string

Explanation for cancellation

$rejecter_id : int

ID of member cancelling

$expiresOn : DateTime

When warrants should terminate

Return values
ServiceResult

Always returns success

decline()

Decline an entire warrant roster and cancel all contained warrants.

public decline(int $warrant_roster_id, int $rejecter_id, string $reason) : ServiceResult
Parameters
$warrant_roster_id : int

ID of the WarrantRoster to decline

$rejecter_id : int

ID of the member declining

$reason : string

Explanation for the decline

Return values
ServiceResult

Success if declined, failure with errors

declineSingleWarrant()

Decline a single warrant within a roster.

public declineSingleWarrant(int $warrant_id, string $reason, int $rejecter_id) : ServiceResult
Parameters
$warrant_id : int

ID of the warrant to decline

$reason : string

Explanation for decline

$rejecter_id : int

ID of member declining

Return values
ServiceResult

Success if declined, failure with errors

getWarrantPeriod()

Find or create a warrant period covering the specified date range.

public getWarrantPeriod(DateTime $startOn, DateTime|null $endOn) : WarrantPeriod|null
Parameters
$startOn : DateTime

Desired warrant start date

$endOn : DateTime|null

Desired warrant end date

Return values
WarrantPeriod|null

Matching period, or null if none found

request()

Submit a batch of warrant requests for approval.

public request(string $request_name, string $desc, array<string|int, WarrantRequest$warrantRequests) : ServiceResult
Parameters
$request_name : string

Name for the warrant roster

$desc : string

Description of the warrant requests

$warrantRequests : array<string|int, WarrantRequest>

Array of warrant request objects

Return values
ServiceResult

Success with roster ID, or failure with errors


        
On this page

Search results