Skip to content

Enum Reference

ExportType

namespace BioTime\Enums; — a backed string enum, used by Attendances::export().

php
enum ExportType: string
{
    case CSV = 'csv';
    case TXT = 'txt';
    case XLS = 'xls';

    public function mimeType(): string;   // Content-Type for this export type
    public function extension(): string;  // Suggested filename extension (equal to $this->value)
}
Case->value->mimeType()
ExportType::CSV'csv'text/csv
ExportType::TXT'txt'text/plain
ExportType::XLS'xls'application/vnd.ms-excel

Attendances::export() accepts either an ExportType case or a plain string (ExportType|string), so export('csv', ...) and export(ExportType::CSV, ...) are equivalent. See Attendances → Exporting.

Distributed under the MIT License.