Evidence
Evidence entity - Archivo/enlace de evidencia adjuntado a un GatePassage. Cada evidencia es inmutable una vez creada: se asocia al pasaje y no cambia. Puede ser un archivo local (filePath) o una URL externa (fileUrl), o ambos.
Evidence::__construct()
public function __construct():Evidence::getId()
public function getId(): intEvidence::getUuid()
public function getUuid(): stringEvidence::getEvidenceType()
public function getEvidenceType(): Milpa\Workflow\Enums\EvidenceTypeObtiene el tipo como enum EvidenceType.
Evidence::getTypeValue()
public function getTypeValue(): stringEvidence::getTitle()
public function getTitle(): stringEvidence::getDescription()
public function getDescription(): ?stringEvidence::getFilePath()
public function getFilePath(): ?stringEvidence::getFileUrl()
public function getFileUrl(): ?stringEvidence::getMimeType()
public function getMimeType(): ?stringEvidence::getFileSize()
public function getFileSize(): ?intEvidence::getMetadata()
public function getMetadata(): ?arrayEvidence::getCreatedAt()
public function getCreatedAt(): DateTimeEvidence::getGatePassage()
public function getGatePassage(): Milpa\Workflow\Entities\GatePassageEvidence::getUploadedBy()
public function getUploadedBy(): stringEvidence::setType()
public function setType(Milpa\Workflow\Enums\EvidenceType $type): selfSets the evidence type.
Parameters
| Name | Type | Description |
|---|---|---|
| $type | Milpa\Workflow\Enums\EvidenceType |
Evidence::setTitle()
public function setTitle(string $title): selfSets the evidence's descriptive title.
Parameters
| Name | Type | Description |
|---|---|---|
| $title | string |
Evidence::setDescription()
public function setDescription(?string $description): selfSets the evidence's optional description.
Parameters
| Name | Type | Description |
|---|---|---|
| $description | ?string |
Evidence::setFilePath()
public function setFilePath(?string $filePath): selfSets the local filesystem path to the evidence file.
Parameters
| Name | Type | Description |
|---|---|---|
| $filePath | ?string |
Evidence::setFileUrl()
public function setFileUrl(?string $fileUrl): selfSets the external URL of the evidence file.
Parameters
| Name | Type | Description |
|---|---|---|
| $fileUrl | ?string |
Evidence::setMimeType()
public function setMimeType(?string $mimeType): selfSets the evidence file's MIME type.
Parameters
| Name | Type | Description |
|---|---|---|
| $mimeType | ?string |
Evidence::setFileSize()
public function setFileSize(?int $fileSize): selfSets the evidence file's size in bytes.
Parameters
| Name | Type | Description |
|---|---|---|
| $fileSize | ?int |
Evidence::setMetadata()
public function setMetadata(?array $metadata): selfSets additional metadata for the evidence.
Parameters
| Name | Type | Description |
|---|---|---|
| $metadata | (array<string, mixed> | null) |
Evidence::setGatePassage()
public function setGatePassage(Milpa\Workflow\Entities\GatePassage $gatePassage): selfAssociates this evidence with the gate passage it belongs to.
Parameters
| Name | Type | Description |
|---|---|---|
| $gatePassage | Milpa\Workflow\Entities\GatePassage |
Evidence::setUploadedBy()
public function setUploadedBy(string $uploadedBy): selfSets the opaque principal that uploaded the evidence (e.g. "member:42"); never resolved to an entity by the engine — the consuming product owns identity (D9).
Parameters
| Name | Type | Description |
|---|---|---|
| $uploadedBy | string |
Evidence::hasFile()
public function hasFile(): boolVerifica si la evidencia tiene un archivo local.
Evidence::hasUrl()
public function hasUrl(): boolVerifica si la evidencia tiene una URL externa.
Evidence::isImage()
public function isImage(): boolVerifica si el archivo es una imagen.
Evidence::getFormattedFileSize()
public function getFormattedFileSize(): stringObtiene el tamano del archivo formateado.
Evidence::toArray()
public function toArray(): arrayConverts the entity to an array for API responses.