Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DoctrineObject use AbstractHydrator's namingStrategy #421

Merged
merged 6 commits into from Jul 11, 2014

Conversation

MidnightDesign
Copy link
Contributor

Currently the DoctrineObject hydrator doesn't use AbstractHydrator::$namingStrategy, which means we can't use underscore_fields in forms when our entity uses camelCase as field names. This commit fixes that. I haven't written any tests since I wouldn't be able match the quality of the other tests in this repo. All existing test do work, of course.

@Ocramius
Copy link
Member

I'd need tests for this PR to be acceptable.

@@ -177,6 +177,9 @@ protected function extractByValue($object)

$data = array();
foreach ($fieldNames as $fieldName) {
if ($this->hasNamingStrategy()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this check into a private method, and just always do $fieldName = $this->computeFieldName($fieldName);?

@MidnightDesign
Copy link
Contributor Author

I'm sorry, but I can't figure out why it's not passing. Any hints?

@Ocramius
Copy link
Member

Seems like it actually passed

@Ocramius Ocramius added this to the 0.9.0 milestone Jul 11, 2014
@Ocramius Ocramius self-assigned this Jul 11, 2014
Ocramius added a commit that referenced this pull request Jul 11, 2014
Make DoctrineObject use AbstractHydrator's namingStrategy
@Ocramius Ocramius merged commit fe73345 into doctrine:master Jul 11, 2014
@Ocramius
Copy link
Member

@MidnightDesign thanks!

@gianarb gianarb mentioned this pull request Mar 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants