100 lines
2.5 KiB
PHP
100 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace Lucent\Schema;
|
|
|
|
readonly class System
|
|
{
|
|
function __construct(
|
|
public string $name,
|
|
public string $label,
|
|
public string $ui,
|
|
public bool $files,
|
|
)
|
|
{
|
|
}
|
|
|
|
|
|
public static function getById(string $id): System
|
|
{
|
|
return self::list()[$id];
|
|
}
|
|
|
|
/**
|
|
* @return array<string,System>
|
|
* */
|
|
public static function list(): array
|
|
{
|
|
return [
|
|
"_sys.status" => new System(
|
|
name: "status",
|
|
label: "Status",
|
|
ui: "status",
|
|
files: false,
|
|
),
|
|
"_sys.createdBy" => new System(
|
|
name: "_sys.createdBy",
|
|
label: "Created by",
|
|
ui: "user",
|
|
files: false,
|
|
),
|
|
"_sys.updatedBy" => new System(
|
|
name: "_sys.updatedBy",
|
|
label: "Updated by",
|
|
ui: "user",
|
|
files: false,
|
|
),
|
|
"_sys.createdAt" => new System(
|
|
name: "_sys.createdAt",
|
|
label: "Created at",
|
|
ui: "datetime",
|
|
files: false,
|
|
),
|
|
"_sys.updatedAt" => new System(
|
|
name: "_sys.updatedAt",
|
|
label: "Updated At",
|
|
ui: "datetime",
|
|
files: false,
|
|
),
|
|
"_file.path" => new System(
|
|
name: "_file.path",
|
|
label: "Filename",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
"_file.mime" => new System(
|
|
name: "_file.mime",
|
|
label: "Mime Type",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
|
|
"_file.width" => new System(
|
|
name: "_file.width",
|
|
label: "Dimensions",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
"_file.size" => new System(
|
|
name: "_file.size",
|
|
label: "Size",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
"_file.originalName" => new System(
|
|
name: "_file.originalName",
|
|
label: "Original Name",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
"_file.checksum" => new System(
|
|
name: "_file.checksum",
|
|
label: "Checksum",
|
|
ui: "text",
|
|
files: true,
|
|
),
|
|
|
|
|
|
];
|
|
}
|
|
}
|