$field->id, "alias" => $field->alias, "name" => $field->name, "type" => $field->type, "help" => $field->help, "rank" => $field->rank, "required" => $field->required, "readonly" => $field->readonly, "hidden" => $field->hidden, "translatable" => $field->translatable, "props" => json_encode($field->props), "schema_id" => $field->schemaId, ]; } public static function fromDb(stdClass $data): Field { return new Field( id: data_get($data, "id"), alias: data_get($data, "alias"), name: data_get($data, "name"), type: data_get($data, "type"), help: data_get($data, "help"), schemaId: data_get($data, "schema_id"), rank: data_get($data, "rank"), required: data_get($data, "required"), readonly: data_get($data, "readonly"), hidden: data_get($data, "hidden"), translatable: data_get($data, "translatable"), props: FieldProp::fromDb( data_get($data, "type"), data_get($data, "props"), ), ); } }