|
[
Permalink
| « Hide
]
Jonathan H. Wage added a comment - 24/Nov/09 12:01 AM
In Doctrine 1.2 you can create custom hydrators. You can extend the core hydrators to remove the data you want? I think that would work.
Sure enough, that does the trick!
There are a couple of downsides, though, that might be worth considering in terms of future development: 1. It would be nice to be able to specify constructor arguments for the hydrator, so that collaborators can be injected. In my example, the hydrator needs access to the application's access control list object; currently it's simply retrieving it from a global registry, but it would be nice for testing's sake to be able to inject it instead. Ultimately, I'd still kind of like to see another listener method available ...say, preHydrateResultSet() and postHydrateResultSet()? I think that would be a more flexible approach, even though the custom hydrator solution works quite well. Thanks! I like the idea. I'll move this to 1.3. I don't think we're gonna have a 1.3 version but if we do, it'll be there.
We can include this in a 1.2.x release if you would like to provide a patch and some tests. Thanks, Jon
|
||||||||||||||||||||||||||||||||||||||