Form data to typed classes

dkorpar
Member | 136
+
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…

Marek Bartoš
Nette Blogger | 1275
+
+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
Member | 136
+
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 | 3608
+
0
-

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

dkorpar
Member | 136
+
+5
-

@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?