[Flow] array of objects and validators
Bastian Waidelich
bastian at typo3.org
Tue Oct 15 11:29:41 CEST 2013
mario chiari wrote:
Hi Mario,
> I need some help with validators.
> Say I have a basic Father/Son model, and a New template to create
> several Fathers and theirs Sons at once.
"Several fathers" - I wouldn't call that basic but rather modern, but we
already had that didn't we :)
> http://pastebin.com/jJk2Aqb3 .
>
> My createAction cycles over the array of Fathers and creates Father
> objects by
> $fatherObj = $propertyMapper->convert($fthArray, '\...\Model\Father');
You shouldn't have to use the PropertyMapper manually. Ever.
Don't
http://pastebin.com/k5khWf1t
work for you? Then validation is applied automagically.
--
Bastian Waidelich
--
Core Developer Team
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the Flow
mailing list