edges wip

This commit is contained in:
2026-01-10 02:09:50 +02:00
parent 87ab1f57fd
commit ced6146266
19 changed files with 380 additions and 271 deletions
@@ -6,6 +6,7 @@ class FieldProp
{
return match ($type) {
"text" => new TextFieldProp(min: 0, max: 0, default: ""),
"relation" => new RelationFieldProp(schemas: [], min: 0, max: 0),
default => new InvalidFieldProp(),
};
}
@@ -24,6 +25,11 @@ class FieldProp
max: $props["max"] ?? 0,
default: $props["default"] ?? "",
),
"relation" => new RelationFieldProp(
schemas: $props["schemas"] ?? [],
min: $props["min"] ?? 0,
max: $props["max"] ?? 0,
),
default => new InvalidFieldProp(),
};
}
@@ -0,0 +1,10 @@
<?php namespace Lucent\Core\Schema\Data\FieldProp;
class RelationFieldProp implements IFieldProp
{
public function __construct(
public array $schemas,
public int $min,
public int $max,
) {}
}