edit schema wip
This commit is contained in:
@@ -18,10 +18,15 @@ class FieldProp
|
||||
};
|
||||
}
|
||||
|
||||
public static function fromDb(string $propsJson): IFieldProp
|
||||
public static function fromDb(string $type, string $propsJson): IFieldProp
|
||||
{
|
||||
$props = json_decode($propsJson, true);
|
||||
return match ($props["type"]) {
|
||||
return self::fromArray($type, $props);
|
||||
}
|
||||
|
||||
public static function fromArray(string $type, array $props): IFieldProp
|
||||
{
|
||||
return match ($type) {
|
||||
"text" => new TextFieldProp(
|
||||
required: $props["required"] ?? false,
|
||||
readonly: $props["readonly"] ?? false,
|
||||
|
||||
Reference in New Issue
Block a user