0

I'm quite new to Zend Framework 2, so I'd like to ask for your help on a doubt about hydration:

I've got a ResultSet that I'm hydrating into shipping methods - most of them are standard, but there are some custom shipping methods, identified in the table via a column.

I'd now like to hydrate the standard ones into ShippingMethod objects, but the custom ones into other classes' objects.

May I ask you to point me into the right direction?

Thanks in advance!

David
  • 7
  • 3
  • one possible solution for me would be adding decorators afterwards, say, hydrate into ShippingMethods object and afterwards go through them and add decorators depending on the custom column value - what do you think? – David Apr 22 '16 at 07:40

1 Answers1

0

You can use an aggregator hydrator which is use to built multiple object with different hydrator.

Unex
  • 1,747
  • 13
  • 17
  • Thanks, but as I understand it this would enable me to add the main shipping method additional objects, but not return different classes right? – David Apr 26 '16 at 12:58