GatePassage
GatePassage entity - Registro append-only de solicitudes/aprobaciones de gates. Cada registro representa una solicitud para pasar un gate del pipeline. NUNCA se hace UPDATE ni DELETE. Solo INSERT. Una vez creado, el pasaje se resuelve (approve/reject) una sola vez y queda inmutable. Uses polymorphic model: entity_type + entity_id instead of direct FK. CONSTRAINT CRITICO: requestedBy != approvedBy (prohibicion de auto-aprobacion, enforced a nivel de servicio). `requestedBy`/`approvedBy` are opaque principal strings (e.g. "member:42"), matching {@see Evidence::getUploadedBy()} — the engine stores them verbatim and never resolves them to an entity; the consuming product owns identity (D9).
GatePassage::__construct()
public function __construct():GatePassage::getId()
public function getId(): intGatePassage::getUuid()
public function getUuid(): stringGatePassage::getStatus()
public function getStatus(): Milpa\Workflow\Enums\GatePassageStatusObtiene el estado como enum GatePassageStatus.
GatePassage::getStatusValue()
public function getStatusValue(): stringGatePassage::getRequestedNotes()
public function getRequestedNotes(): ?stringGatePassage::getApprovedNotes()
public function getApprovedNotes(): ?stringGatePassage::getRejectedReason()
public function getRejectedReason(): ?stringGatePassage::isWaiver()
public function isWaiver(): boolGatePassage::getWaiverJustification()
public function getWaiverJustification(): ?stringGatePassage::getMetadata()
public function getMetadata(): ?arrayGatePassage::getCreatedAt()
public function getCreatedAt(): DateTimeGatePassage::getResolvedAt()
public function getResolvedAt(): ?DateTimeGatePassage::getGateDefinition()
public function getGateDefinition(): Milpa\Workflow\Entities\GateDefinitionGatePassage::getEntityType()
public function getEntityType(): stringGatePassage::getEntityId()
public function getEntityId(): intGatePassage::getRequestedBy()
public function getRequestedBy(): stringGatePassage::getApprovedBy()
public function getApprovedBy(): ?stringGatePassage::getEvidences()
public function getEvidences(): Doctrine\Common\Collections\CollectionGatePassage::setStatus()
public function setStatus(Milpa\Workflow\Enums\GatePassageStatus $status): selfSets the passage's status.
Parameters
| Name | Type | Description |
|---|---|---|
| $status | Milpa\Workflow\Enums\GatePassageStatus |
GatePassage::setRequestedNotes()
public function setRequestedNotes(?string $requestedNotes): selfSets the requester's notes at the time the passage was requested.
Parameters
| Name | Type | Description |
|---|---|---|
| $requestedNotes | ?string |
GatePassage::setApprovedNotes()
public function setApprovedNotes(?string $approvedNotes): selfSets the approver's notes at the time the passage was approved.
Parameters
| Name | Type | Description |
|---|---|---|
| $approvedNotes | ?string |
GatePassage::setRejectedReason()
public function setRejectedReason(?string $rejectedReason): selfSets the reason the passage was rejected.
Parameters
| Name | Type | Description |
|---|---|---|
| $rejectedReason | ?string |
GatePassage::setIsWaiver()
public function setIsWaiver(bool $isWaiver): selfSets whether this passage was waived instead of meeting its requirements.
Parameters
| Name | Type | Description |
|---|---|---|
| $isWaiver | bool |
GatePassage::setWaiverJustification()
public function setWaiverJustification(?string $waiverJustification): selfSets the justification for the waiver (required when {@see self::isWaiver()} is true).
Parameters
| Name | Type | Description |
|---|---|---|
| $waiverJustification | ?string |
GatePassage::setMetadata()
public function setMetadata(?array $metadata): selfSets additional metadata for the passage.
Parameters
| Name | Type | Description |
|---|---|---|
| $metadata | (array<string, mixed> | null) |
GatePassage::setGateDefinition()
public function setGateDefinition(Milpa\Workflow\Entities\GateDefinition $gateDefinition): selfSets the gate definition this passage requests to pass.
Parameters
| Name | Type | Description |
|---|---|---|
| $gateDefinition | Milpa\Workflow\Entities\GateDefinition |
GatePassage::setEntityType()
public function setEntityType(string $entityType): selfSets the polymorphic entity type this passage belongs to (e.g. "opportunity").
Parameters
| Name | Type | Description |
|---|---|---|
| $entityType | string |
GatePassage::setEntityId()
public function setEntityId(int $entityId): selfSets the polymorphic entity ID this passage belongs to.
Parameters
| Name | Type | Description |
|---|---|---|
| $entityId | int |
GatePassage::setRequestedBy()
public function setRequestedBy(string $requestedBy): selfSets the opaque principal that requested the passage (e.g. "member:42"); never resolved to an entity by the engine — the consuming product owns identity (D9).
Parameters
| Name | Type | Description |
|---|---|---|
| $requestedBy | string |
GatePassage::setApprovedBy()
public function setApprovedBy(?string $approvedBy): selfSets the opaque principal that approved or rejected the passage; never resolved to an entity by the engine (D9). Must not equal {@see self::getRequestedBy()}.
Parameters
| Name | Type | Description |
|---|---|---|
| $approvedBy | ?string |
GatePassage::addEvidence()
public function addEvidence(Milpa\Workflow\Entities\Evidence $evidence): selfAdds a piece of evidence to this passage, wiring the inverse side back.
Parameters
| Name | Type | Description |
|---|---|---|
| $evidence | Milpa\Workflow\Entities\Evidence |
GatePassage::removeEvidence()
public function removeEvidence(Milpa\Workflow\Entities\Evidence $evidence): selfRemoves a piece of evidence from this passage.
Parameters
| Name | Type | Description |
|---|---|---|
| $evidence | Milpa\Workflow\Entities\Evidence |
GatePassage::approve()
public function approve(string $approverId, ?string $notes = null): selfAprueba el pasaje del gate. CONSTRAINT: El aprobador no puede ser el mismo que el solicitante.
Parameters
| Name | Type | Description |
|---|---|---|
| $approverId | string | |
| $notes | ?string |
GatePassage::reject()
public function reject(string $approverId, string $reason): selfRechaza el pasaje del gate. CONSTRAINT: El aprobador no puede ser el mismo que el solicitante.
Parameters
| Name | Type | Description |
|---|---|---|
| $approverId | string | |
| $reason | string |
GatePassage::isPending()
public function isPending(): boolVerifica si el pasaje esta pendiente de resolucion.
GatePassage::isApproved()
public function isApproved(): boolVerifica si el pasaje fue aprobado.
GatePassage::isRejected()
public function isRejected(): boolVerifica si el pasaje fue rechazado.
GatePassage::toArray()
public function toArray(): arrayConverts the entity to an array for API responses. NOTA: requestedBy != approvedBy (self-approval prohibition, enforced at service level). Both are opaque principal strings (D9) — see the class docblock.