Filters & hydrators #5099

flip111 opened this Issue Sep 10, 2013 · 4 comments

3 participants


I was trying to make a hydrator and using filters. I made a small code to use a hydrator with annotations. And i came to the following problems:

->filter() does not have a generic interface. Sometimes only the propertyName is passed sometimes the \nameSpace\Class::Property
the FQCN is useful because then you can get the reflection information. But some combinations of hydrators and filters are not compatible.

(This is more a problem about the hydrators)
There are only filters used for extracting and not hydrating. Of course you can filter the array yourself before you hydrate but then it's not good for re-use of code and seperation of concerns.


Here is an example where filter takes class::property

Here is an example where filter takes propertyName

There is no example of the filter taking the property value (but it could, because the interface/standard doesn't specify that).

I need a filter that can take the value as well as a ReflectionProperty (or get a class + property to build the reflection property from there)

Zend Framework member

What about passing the hydrated/extraction object to the filter?

So basically modify filters to handle filter($propertyName, $object, $context)?

Just a wild guess on how this could be enhanced.


That would be perfect, it won't be compatible with the current interface though. Maybe it will work, but the interface doesn't specify this.

@GeeH GeeH added the To Be Closed label Mar 5, 2016

This issue has been closed as part of the bug migration program as outlined here -

@GeeH GeeH closed this Jun 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment