[TYPO3-mvc] Mapping various Objects to a Domain Model

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Sat Jun 16 12:59:36 CEST 2012


Ye, but the point is, the data will never fit to any model,
because the JSON data's structure is totally different and
doesn't match the model's properties at all.

I need to process each data node/property of the JSON data
manually and assign it to the model. The question is how
can I do this in an elegant and flexible way without polluting
the model itselt. The question is where should I put this
code and how should I load/call it.

Should I add this code to a model service or should I
create a separate utility for this or could I use the
new SignalSlot mechanism etc.

That's the best solution to populate a model object with
custom, unstructured data which comes from a web service?

Thanks for your feedback! ;)

Thomas

Frank Krüger schrieb:
> the first argument for the DataMapper is the model name to which the DataArray should be mapped, either it fits (and all validator rules are satisfied) or not, so IMHO it's not the mappers task to decide which model to use, it is yours.


More information about the TYPO3-project-typo3v4mvc mailing list