KMP PHP API Reference

DefaultWarrantManager
in package
implements WarrantManagerInterface

Table of Contents

Interfaces

WarrantManagerInterface
Warrant Manager Interface

Properties

$activeWindowManager  : ActiveWindowManagerInterface
$triggerDispatcher  : TriggerDispatcher

Methods

__construct()  : mixed
Constructor.
activateApprovedRoster()  : ServiceResult
Activate warrants for a roster that the workflow has already approved.
cancel()  : ServiceResult
Cancel.
cancelByEntity()  : ServiceResult
Cancel by entity.
decline()  : ServiceResult
Decline a warrant roster that the workflow has already rejected.
declineSingleWarrant()  : ServiceResult
Decline single warrant.
getWarrantPeriod()  : WarrantPeriod|null
Get warrant period.
request()  : ServiceResult
Request.
syncWorkflowApprovalToRoster()  : ServiceResult
Sync workflow approval responses onto the roster summary fields.
withdrawPendingRequests()  : ServiceResult
Withdraw all in-flight warrants for one exact warrant identity.
cancelWarrant()  : ServiceResult
Cancel warrant.
declineWarrant()  : ServiceResult
Decline warrant.
stopWarrantDependants()  : ServiceResult
Stop warrant dependants.
addNewRosterReplacementNote()  : void
addRosterReplacementNote()  : void
Record how an older roster was affected by a replacement request.
addRosterWithdrawalNote()  : void
Record why pending warrants were withdrawn without a replacement roster.
findEquivalentPendingRoster()  : int|null
Return a healthy roster only when the request is an exact retry.
findMatchingPendingWarrants()  : array<string|int, Warrant>
Find in-flight warrants for any requested warrant subject.
getRosterIds()  : array<string|int, int>
lockActiveRosterWorkflows()  : array<int, array<string|int, int>>
Lock approval workflows that can still act on matching pending warrants.
lockMemberIds()  : array<int, Member>
lockRequestedMembers()  : array<int, Member>
Lock warrant recipients in a stable order to serialize pending requests.
normalizeRequests()  : array<int, array<string, mixed>>
Resolve requested dates into concrete warrant-period windows.
pendingWarrantIsEquivalent()  : bool
saveRosterNote()  : void
Persist a public audit note against a warrant roster.
supersedePendingWarrants()  : array<string|int, int>
Replace pending warrants and close old rosters that no longer contain work.
warrantIdentityKey()  : string

Properties

Methods

activateApprovedRoster()

Activate warrants for a roster that the workflow has already approved.

public activateApprovedRoster(int $rosterId, int $approverId) : ServiceResult
Parameters
$rosterId : int

Warrant roster ID

$approverId : int

Member performing the approval

Return values
ServiceResult

cancel()

Cancel.

public cancel(mixed $warrant_id, mixed $reason, mixed $rejecter_id, mixed $expiresOn) : ServiceResult
Parameters
$warrant_id : mixed
$reason : mixed
$rejecter_id : mixed
$expiresOn : mixed
Return values
ServiceResult

cancelByEntity()

Cancel by entity.

public cancelByEntity(mixed $entityType, mixed $entityId, mixed $reason, mixed $rejecter_id, mixed $expiresOn) : ServiceResult
Parameters
$entityType : mixed
$entityId : mixed
$reason : mixed
$rejecter_id : mixed
$expiresOn : mixed
Return values
ServiceResult

decline()

Decline a warrant roster that the workflow has already rejected.

public decline(mixed $warrant_roster_id, mixed $rejecter_id, mixed $reason) : ServiceResult

Pure domain work: declines all pending warrants on the roster, stops their dependants, and transitions the roster to DECLINED. This is the decline counterpart to self::activateApprovedRoster() and must NOT drive the workflow engine — the engine has already routed to this action via the approval-gate's rejected port before this runs.

Parameters
$warrant_roster_id : mixed

Warrant roster ID

$rejecter_id : mixed

Member performing the decline

$reason : mixed

Reason for the decline

Return values
ServiceResult

declineSingleWarrant()

Decline single warrant.

public declineSingleWarrant(mixed $warrant_id, mixed $reason, mixed $rejecter_id) : ServiceResult
Parameters
$warrant_id : mixed
$reason : mixed
$rejecter_id : mixed
Return values
ServiceResult

request()

Request.

public request(mixed $request_name, mixed $desc, mixed $warrantRequests[, int|null $requestedBy = null ]) : ServiceResult
Parameters
$request_name : mixed
$desc : mixed
$warrantRequests : mixed
$requestedBy : int|null = null

Member ID of the user who initiated the request

Return values
ServiceResult

syncWorkflowApprovalToRoster()

Sync workflow approval responses onto the roster summary fields.

public syncWorkflowApprovalToRoster(int $rosterId, int $approverId[, string|null $notes = null ][, DateTimeInterface|null $approvedOn = null ]) : ServiceResult
Parameters
$rosterId : int

Warrant roster ID

$approverId : int

Member providing the approval

$notes : string|null = null

Optional approval notes

$approvedOn : DateTimeInterface|null = null

Approval timestamp

Return values
ServiceResult

withdrawPendingRequests()

Withdraw all in-flight warrants for one exact warrant identity.

public withdrawPendingRequests(string $entityType, int $entityId, int $memberId, int|null $memberRoleId, int $requestedBy, string $reason) : ServiceResult
Parameters
$entityType : string

Warranted entity type

$entityId : int

Warranted entity ID

$memberId : int

Warrant recipient

$memberRoleId : int|null

Linked member-role assignment

$requestedBy : int

Member recording the withdrawal

$reason : string

Audit reason

Tags
inheritDoc
Return values
ServiceResult

Success with the withdrawn warrant count

cancelWarrant()

Cancel warrant.

protected cancelWarrant(mixed $warrantTable, mixed $warrant, mixed $expiresOn, mixed $rejecter_id, mixed $reason) : ServiceResult
Parameters
$warrantTable : mixed
$warrant : mixed
$expiresOn : mixed
$rejecter_id : mixed
$reason : mixed
Return values
ServiceResult

declineWarrant()

Decline warrant.

protected declineWarrant(mixed $warrantTable, mixed $warrant, mixed $rejecter_id, mixed $reason) : ServiceResult
Parameters
$warrantTable : mixed
$warrant : mixed
$rejecter_id : mixed
$reason : mixed
Return values
ServiceResult

addNewRosterReplacementNote()

private addNewRosterReplacementNote(int $newRosterId, array<string|int, int> $oldRosterIds, int|null $actorId) : void
Parameters
$newRosterId : int
$oldRosterIds : array<string|int, int>
$actorId : int|null

addRosterReplacementNote()

Record how an older roster was affected by a replacement request.

private addRosterReplacementNote(int $oldRosterId, int $newRosterId, int|null $actorId, bool $fullyReplaced) : void
Parameters
$oldRosterId : int
$newRosterId : int
$actorId : int|null
$fullyReplaced : bool

addRosterWithdrawalNote()

Record why pending warrants were withdrawn without a replacement roster.

private addRosterWithdrawalNote(int $rosterId, int|null $actorId, string $reason, bool $fullyReplaced) : void
Parameters
$rosterId : int
$actorId : int|null
$reason : string
$fullyReplaced : bool

findEquivalentPendingRoster()

Return a healthy roster only when the request is an exact retry.

private findEquivalentPendingRoster(array<int, array<string, mixed>> $normalizedRequests, array<string|int, Warrant$pendingWarrants, array<int, array<string|int, int>> $workflowIdsByRoster) : int|null
Parameters
$normalizedRequests : array<int, array<string, mixed>>
$pendingWarrants : array<string|int, Warrant>
$workflowIdsByRoster : array<int, array<string|int, int>>
Return values
int|null

findMatchingPendingWarrants()

Find in-flight warrants for any requested warrant subject.

private findMatchingPendingWarrants(array<int, array<string, mixed>> $normalizedRequests) : array<string|int, Warrant>
Parameters
$normalizedRequests : array<int, array<string, mixed>>
Return values
array<string|int, Warrant>

getRosterIds()

private getRosterIds(array<string|int, Warrant$warrants) : array<string|int, int>
Parameters
$warrants : array<string|int, Warrant>
Return values
array<string|int, int>

lockActiveRosterWorkflows()

Lock approval workflows that can still act on matching pending warrants.

private lockActiveRosterWorkflows(array<string|int, int> $rosterIds) : array<int, array<string|int, int>>
Parameters
$rosterIds : array<string|int, int>
Return values
array<int, array<string|int, int>>

lockMemberIds()

private lockMemberIds(array<string|int, int> $memberIds) : array<int, Member>
Parameters
$memberIds : array<string|int, int>
Return values
array<int, Member>

normalizeRequests()

Resolve requested dates into concrete warrant-period windows.

private normalizeRequests(array<string|int, WarrantRequest$requests, array<int, Member$members) : array<int, array<string, mixed>>
Parameters
$requests : array<string|int, WarrantRequest>
$members : array<int, Member>
Return values
array<int, array<string, mixed>>

pendingWarrantIsEquivalent()

private pendingWarrantIsEquivalent(Warrant $warrant, array<string, mixed> $request) : bool
Parameters
$warrant : Warrant
$request : array<string, mixed>
Return values
bool

saveRosterNote()

Persist a public audit note against a warrant roster.

private saveRosterNote(int $rosterId, string $subject, string $body, int $actorId) : void
Parameters
$rosterId : int
$subject : string
$body : string
$actorId : int

supersedePendingWarrants()

Replace pending warrants and close old rosters that no longer contain work.

private supersedePendingWarrants(array<string|int, Warrant$pendingWarrants, array<int, array<string|int, int>> $workflowIdsByRoster, int|null $actorId, int|null $replacementRosterId, string $reason) : array<string|int, int>
Parameters
$pendingWarrants : array<string|int, Warrant>
$workflowIdsByRoster : array<int, array<string|int, int>>
$actorId : int|null

Member recording the replacement

$replacementRosterId : int|null

Fresh roster ID, or null for withdrawal

$reason : string

Audit reason

Return values
array<string|int, int>

Affected old roster IDs

warrantIdentityKey()

private warrantIdentityKey(array<string, mixed> $warrant) : string
Parameters
$warrant : array<string, mixed>
Return values
string
On this page

Search results