schemas and fields
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php namespace Lucent\Core\Schema;
|
||||
|
||||
use Lucent\Core\Schema\Data\Field;
|
||||
|
||||
class FieldModule
|
||||
{
|
||||
public static function fromArray(array $data): Field
|
||||
{
|
||||
return new Field(
|
||||
id: $data["id"],
|
||||
alias: $data["alias"],
|
||||
name: $data["name"],
|
||||
type: $data["type"],
|
||||
);
|
||||
}
|
||||
|
||||
public static function toDb(Field $field): array
|
||||
{
|
||||
return [
|
||||
"id" => $field->id,
|
||||
"alias" => $field->alias,
|
||||
"name" => $field->name,
|
||||
"type" => $field->type,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user