Form data to typed classes

dkorpar
Backer | 96
+
0
-

Are there any build in way of mapping form values to some kind of a typed entity, where we can force variable types?
Maybe some integration with https://github.com/nette/schema, would be specially interesting with php 7.4 and typed properties…

Mabar
Member | 293
+
+1
-

$form->setMappedType(TypedEntity::class), internally calls new TypedEntity and assigns values to public properties. Don't know about anything better and open-sourced yet.

dkorpar
Backer | 96
+
0
-

@Mabar thanks I know I saw that somewhere, now was checking docs but can't find anything about it… @DavidGrudl maybe updating docs with this?

CZechBoY
Member | 3605
+
0
-

anybody can update it via pr https://github.com/nette/docs

dkorpar
Backer | 96
+
+3
-

@CZechBoY if only we would know if it exists… Maybe best thing would be that person who adds some feature is required to put it to docs… PR wouldn't be merged until PR is made for docs and when merged both is merged feature and docs?