Set hydrator to Zend Element Collections only if the target fieldset does not have any Collections
Zend\Form\Element\Collection allows to set a hydrator that will be used per fieldset object in the collection. This is the straightforward way to hydrate/extract.
But if any of your elements in the Collections target fieldset is a Collections element, the extract is not propagated to the inner Collections hydrator.
For this to work, do not set the Collections hydrator. Instead, set the hydrator of the target fieldset. Now each object in the collection will check if the target fieldset has a hydrator and call it.
Refer: Zend\Form\Element\Collection::extract()
Written by Pradeep
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zend
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#