ClassMethods hydrator not nydrating fields from database #4416

Closed
XaeroDegreaz opened this Issue May 4, 2013 · 4 comments

Comments

Projects
None yet
5 participants

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.

Contributor

bakura10 commented May 4, 2013

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 commented Nov 18, 2013

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

hash_tag would result to false
hasFoo would result to true

@adamlundrigan adamlundrigan added Hydrator and removed Stdlib labels Nov 6, 2015

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

GeeH commented Jun 27, 2016

This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html

@GeeH GeeH closed this Jun 27, 2016

Three years later. Weee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment