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
Support embedded object for mapping #578
Support embedded object for mapping #578
Conversation
5c99a46
to
2978eb6
Compare
I think he mean if class |
@greg0ire Yes i referring to the doctrine Embeddables. |
Then I am 👍 for your PR! We don't have any support for Embeddables yet, so you might run into other problems later, but we would love PRs to make it work. |
LGTM |
I would like to finish my test before merge. |
Also : it would be nice to document the support for this feature, once we are sure it works in most situations (so maybe in a later PR). |
@@ -98,6 +98,10 @@ public function getValue($object) | |||
$object = $this->getFieldValue($object, $parentAssociationMapping['fieldName']); | |||
} | |||
|
|||
if (isset($this->getFieldMapping()['declaredField'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment about why this condition is here?
Something simple like this:
// Support embedded object for mapping.
// @see http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/tutorials/embeddables.html
@claudusd Your PR does not fix only show mapper but also list. Could you please change the commit title to:
Thanks. |
Ok, i will change the commit message and add documentation. |
Good! BTW I tested your PR manually, works great, good job! 👍 |
Don't merge, I will add more documentation this evening. |
2978eb6
to
60f5167
Compare
@@ -98,6 +98,12 @@ public function getValue($object) | |||
$object = $this->getFieldValue($object, $parentAssociationMapping['fieldName']); | |||
} | |||
|
|||
// Support embedded object for mapping | |||
// Ref: http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/tutorials/embeddables.html | |||
if (isset($this->getFieldMapping()['declaredField'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, beware this syntax (Function array dereferencing
) is only supported from php 5.4 (http://php.net/manual/en/migration54.new-features.php)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have been having a problem with Travis, that's why the build wasn't red, but the next commit will probably report this.
60f5167
to
043e042
Compare
043e042
to
9189b5d
Compare
I fix php 5.3 issue, rebase and add doc. |
Thank you @claudusd! 👍 |
Changelog
Subject
This PR allow to use embedded object in the show mapper.
The FieldDescription method getValue ignore the embedded object and do
With my PR the getter call is on the embedded object and not on the parent object.