...
Expand | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
Okay so now you're mapping items, which can be either a product or a service. In Connec!™ we have a field type that can be either SERVICE, MANUFACTURED or PURCHASED, but in your app you have a type_id that is a meaningless integer. A typical way to approach this is to retrieve the information about the types in YourApp and set it to a TYPE_MAPPER constant:
And then use the mapper in the after_normalize/denormalize hooks:
A typical way to approach this is to retrieve the information about the types in YourApp and set it to a TYPE_MAPPER constant:
And then use the mapper in the after_normalize/denormalize hooks:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
You're trying to map invoices, and you've noticed that invoices can have several lines, and you don't know how to map that. You could do some loops in your after_normalize and after_denormalize hooks to handle the lines, but there's actually a far better way to do it:
|
...