Hi Xander, Thanks for your response. I don't use the Table gateway interface, but directly Zend\Db\Sql statements, and the HydratingResultSet to hydrate my objects. I assume that HydratingResultSet doesn't manage hydration of objects with relations, so I wonder how to do it ...
I know about Doctrine, but in my project it's not an option (at least for the moment). Does anyone has already hydrate such objects ? Best regards, Emmanuel 2014-09-15 23:56 GMT+02:00 Xander Guzman <thesha...@shadowpedia.info>: > Emmanuel, > > I don’t believe the basic Table gateway interface supports this kind of > query, it’s a really simple system. If you’d like something complicated you > should really look into Doctrine http://www.doctrine-project.org/. > > Cheers, > -- > Xander Guzman > xander.guz...@xanderguzman.com > www.xanderguzman.com > > On September 15, 2014 at 3:53:55 PM, Emmanuel Bouton (got...@gmail.com) > wrote: > > Hi all, > > I wonder how to manage properly hydrating phase when my sql statement has > at least one join (with one to many relation). > > Let's take a short example : > https://gist.github.com/goten4/8643c9dc3394adeb8a88 > > I have a common Repository class that manage the simple case, I inject to > the repository the table name, the entity class name, and the hydrator. > > In UserRepository, I inject also the group table name, class name and > hydrator. > How should I override getAll() method in my UserRepository to correctly > hydrate the list of users ? > > Thanks, > Emmanuel > >