edges wip
This commit is contained in:
@@ -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,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user