Skip to content
docsv0.1.0

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(): int

Evidence::getUuid()

public function getUuid(): string

Evidence::getEvidenceType()

public function getEvidenceType(): Milpa\Workflow\Enums\EvidenceType

Obtiene el tipo como enum EvidenceType.

Evidence::getTypeValue()

public function getTypeValue(): string

Evidence::getTitle()

public function getTitle(): string

Evidence::getDescription()

public function getDescription(): ?string

Evidence::getFilePath()

public function getFilePath(): ?string

Evidence::getFileUrl()

public function getFileUrl(): ?string

Evidence::getMimeType()

public function getMimeType(): ?string

Evidence::getFileSize()

public function getFileSize(): ?int

Evidence::getMetadata()

public function getMetadata(): ?array

Evidence::getCreatedAt()

public function getCreatedAt(): DateTime

Evidence::getGatePassage()

public function getGatePassage(): Milpa\Workflow\Entities\GatePassage

Evidence::getUploadedBy()

public function getUploadedBy(): string

Evidence::setType()

public function setType(Milpa\Workflow\Enums\EvidenceType $type): self

Sets the evidence type.

Parameters

Parameters of setType()
NameTypeDescription
$typeMilpa\Workflow\Enums\EvidenceType

Evidence::setTitle()

public function setTitle(string $title): self

Sets the evidence's descriptive title.

Parameters

Parameters of setTitle()
NameTypeDescription
$titlestring

Evidence::setDescription()

public function setDescription(?string $description): self

Sets the evidence's optional description.

Parameters

Parameters of setDescription()
NameTypeDescription
$description?string

Evidence::setFilePath()

public function setFilePath(?string $filePath): self

Sets the local filesystem path to the evidence file.

Parameters

Parameters of setFilePath()
NameTypeDescription
$filePath?string

Evidence::setFileUrl()

public function setFileUrl(?string $fileUrl): self

Sets the external URL of the evidence file.

Parameters

Parameters of setFileUrl()
NameTypeDescription
$fileUrl?string

Evidence::setMimeType()

public function setMimeType(?string $mimeType): self

Sets the evidence file's MIME type.

Parameters

Parameters of setMimeType()
NameTypeDescription
$mimeType?string

Evidence::setFileSize()

public function setFileSize(?int $fileSize): self

Sets the evidence file's size in bytes.

Parameters

Parameters of setFileSize()
NameTypeDescription
$fileSize?int

Evidence::setMetadata()

public function setMetadata(?array $metadata): self

Sets additional metadata for the evidence.

Parameters

Parameters of setMetadata()
NameTypeDescription
$metadata(array<string, mixed> | null)

Evidence::setGatePassage()

public function setGatePassage(Milpa\Workflow\Entities\GatePassage $gatePassage): self

Associates this evidence with the gate passage it belongs to.

Parameters

Parameters of setGatePassage()
NameTypeDescription
$gatePassageMilpa\Workflow\Entities\GatePassage

Evidence::setUploadedBy()

public function setUploadedBy(string $uploadedBy): self

Sets 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

Parameters of setUploadedBy()
NameTypeDescription
$uploadedBystring

Evidence::hasFile()

public function hasFile(): bool

Verifica si la evidencia tiene un archivo local.

Evidence::hasUrl()

public function hasUrl(): bool

Verifica si la evidencia tiene una URL externa.

Evidence::isImage()

public function isImage(): bool

Verifica si el archivo es una imagen.

Evidence::getFormattedFileSize()

public function getFormattedFileSize(): string

Obtiene el tamano del archivo formateado.

Evidence::toArray()

public function toArray(): array

Converts the entity to an array for API responses.