Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ClassMethods hydrator not nydrating fields from database #4416

Open
XaeroDegreaz opened this Issue · 2 comments

3 participants

@XaeroDegreaz

I have a field in my database called hash_tags, but when the hydrator gets loaded from ClassMethods, it always skips adding this field to the returned attributes array.

It looks like it's filtering out the word has. I've had to take a hackish away around this in order to get it to work.

@bakura10

Yes you seems to be right that it only checks if the 3 first letters are "has". https://github.com/zendframework/zf2/blob/master/library/Zend/Stdlib/Hydrator/Filter/HasFilter.php#L23

This is a pretty primitive check to be honest ôÔ. I don't really understand how filters work to be honest (and why they are including by default in the ClassMethods hydrator ?).

Ping @weierophinney , this may be a pretty annoying issue that we should solve for 2.2.

@fhsctv

How about a check if the first letter after 'has' is uppercase?

hash_tag would result to false
hasFoo would result to true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.