mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Load class metadata change problem #5477
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danitome24 on GitHub (Mar 27, 2017).
Hi,
I'm developing with DDD and doctrine and I would use embeddable for Value Objects. In my code, there are some Value Objects that I could reuse but due to a legacy code, these columns on database are different named. So I thought that I could update it on
loadClassMetadatadoctrine event. I also use Symfony.To get this achievement I've started only assigning the embeddable to an entity from doctrine event like the following:

This code works and on dump I can see the embeddable Location object into embeddables array. The problem is when I fetch something and this Value Object (location) is null on my entity (Hotel).
Something wrong?
Versions:
@lcobucci commented on GitHub (Mar 27, 2017):
In general, what you would have to do is actually use the
@AttributeOverridesannotation on you class usingembeddable.attributeas name but due to the current limitation you can't really do it at the moment.I think you're having this issue for the same reason we can't override embeddable objects.
@danitome24 commented on GitHub (Mar 27, 2017):
How can I use
@AttributeOverridesin YAML configuration? @lcobucci@lcobucci commented on GitHub (Mar 27, 2017):
@danitome24
1aa02f9afc/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php (L630)But I recommend you to move away from YAML since it's already removed from the next major release.
@danitome24 commented on GitHub (Mar 27, 2017):
@lcobucci Two last questions:
Thanks a lot 👍
@lcobucci commented on GitHub (Mar 27, 2017):
Also, YAML it's a mess and we had tons of invalid issues because of syntax errors. You can see more on https://github.com/doctrine/doctrine2/pull/5932#issuecomment-233593524
At the moment we're working on different things so it would be amazing if the community could send a PR to
masterthat fixes that (maybe you?).@danitome24 commented on GitHub (Mar 27, 2017):
@lcobucci Thanks a lot...maybe you'll have a PR from me ;). Closing issue!!