Skip to content
docsv0.1.0

GateServiceInterface

`$requesterId`/`$approverId`/`$rejectorId`/`$waiverId` are opaque principal strings (e.g. "member:42"), mirroring {@see \Milpa\Workflow\Entities\Evidence::getUploadedBy()} — the engine stores them verbatim and never resolves them to an entity; the consuming product owns identity (D9).

GateServiceInterface::requestPassage()

abstract public function requestPassage(Milpa\Workflow\Entities\GateDefinition $gate, string $entityType, int $entityId, string $requesterId, ?array $fieldValues = null): Milpa\Workflow\Entities\GatePassage

Requests a new gate passage for the given gate and polymorphic entity.

Parameters

Parameters of requestPassage()
NameTypeDescription
$gateMilpa\Workflow\Entities\GateDefinition
$entityTypestring
$entityIdint
$requesterIdstring
$fieldValues(array<string, mixed> | null)

GateServiceInterface::approvePassage()

abstract public function approvePassage(Milpa\Workflow\Entities\GatePassage $passage, string $approverId, ?string $notes = null): Milpa\Workflow\Entities\GatePassage

Approves a pending gate passage. Implementations must reject the call (typically via `SelfApprovalException`) when `$approverId` equals the passage's requester (D9).

Parameters

Parameters of approvePassage()
NameTypeDescription
$passageMilpa\Workflow\Entities\GatePassage
$approverIdstring
$notes?string

GateServiceInterface::rejectPassage()

abstract public function rejectPassage(Milpa\Workflow\Entities\GatePassage $passage, string $rejectorId, string $reason): Milpa\Workflow\Entities\GatePassage

Rejects a pending gate passage with a reason.

Parameters

Parameters of rejectPassage()
NameTypeDescription
$passageMilpa\Workflow\Entities\GatePassage
$rejectorIdstring
$reasonstring

GateServiceInterface::waiveGate()

abstract public function waiveGate(Milpa\Workflow\Entities\GateDefinition $gate, string $entityType, int $entityId, string $waiverId, string $justification): Milpa\Workflow\Entities\GatePassage

Approves a gate passage without requiring its normal evidence/field requirements, recording the waiver and its justification. Implementations must reject the call (typically via `NonWaivableGateException`) when the gate is not waivable.

Parameters

Parameters of waiveGate()
NameTypeDescription
$gateMilpa\Workflow\Entities\GateDefinition
$entityTypestring
$entityIdint
$waiverIdstring
$justificationstring

GateServiceInterface::getApprovedPassagesForEntity()

abstract public function getApprovedPassagesForEntity(string $entityType, int $entityId): array

Returns every approved gate passage for the given polymorphic entity.

Parameters

Parameters of getApprovedPassagesForEntity()
NameTypeDescription
$entityTypestring
$entityIdint