[Flow] Object creation

Christian Müller christian.mueller at typo3.org
Thu Sep 12 16:12:02 CEST 2013


Hi Bjoern,

Bjoern Haverland wrote:
> Hi everybody,
>
> i´m going to realize a general import/export package, but at the moment
> i got a little bit stuck.
>
> I have a sorting method, where i could assign the import fields to the
> target object fields. I get an array from my form which has fields like
> my entities as they are known from normal form properties
> (entity.property or entity.relatedEntity.property a.s.o.) -> The
> assignment is clear . Now i want to create entities from the import
> source stream based of my assignment. Therefore i´m looking for
> something like an object creator, which does all the stuff like object
> reflection and creation -> analogue to the object creation from a form
> input. Is there something existing yet? I believe it is but where i have
> to look for? Could somebody give me a hint?

Sounds like what you need is the PropertyMapper with his TypeConverters. 
It can for example convert an array of properties to a Model object.

Checkout \TYPO3\Flow\Property\PropertyMapper::convert()

>
> Thanks!
>
> Best regards
>
> Bjoern

Cheers,
Christian


More information about the Flow mailing list