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 Embeddable not transient #8006

Merged
merged 1 commit into from
Feb 13, 2020
Merged

Make Embeddable not transient #8006

merged 1 commit into from
Feb 13, 2020

Conversation

malarzm
Copy link
Member

@malarzm malarzm commented Jan 30, 2020

I believe this was an oversight during original implementation but let's see what tests will tell us. Also this made PHPStan ignore Embeddables (phpstan/phpstan-doctrine#108 (review))

@malarzm malarzm changed the base branch from 2.8.x to 2.7 February 13, 2020 18:41
@malarzm malarzm changed the base branch from 2.7 to 2.8.x February 13, 2020 18:41
@malarzm malarzm changed the base branch from 2.8.x to 2.7 February 13, 2020 20:06
@beberlei beberlei merged commit a692670 into 2.7 Feb 13, 2020
@beberlei beberlei added this to the 2.7.1 milestone Feb 13, 2020
@malarzm malarzm deleted the malarzm-patch-1 branch February 14, 2020 00:21
@beberlei beberlei added the Bug label Feb 15, 2020
@lcobucci
Copy link
Member

@malarzm @beberlei I believe that embedded objects were transient by design (at least it makes sense to me) and this should be reverted.

An embedded object is merely a value object and we shouldn't worry about its life cycle or identity, because that's handled by the entity/aggregate itself.

beberlei added a commit that referenced this pull request Mar 15, 2020
…8006 (#8036)

* Add test case

* Treat parent embeddables as mapped superclasses

* [GH-8031] Bugfix: Get working again on nested embeddables in inherited embeddables.

* Housekeeping: CS

* Update note on limitations

* [GH-8031] Verify assocations still do not work with Embeddables.

* Housekeeping: CS

Co-authored-by: Benjamin Eberlei <[email protected]>
@goetas
Copy link
Member

goetas commented Mar 25, 2020

hi. I believe that this change makes sense, but it broke JMS serializer (see schmittjoh/JMSSerializerBundle#790). How can we now distinguish if a class can be managed by the entity manager?

@malarzm
Copy link
Member Author

malarzm commented Mar 25, 2020

@goetas I believe the question should be "How can we now distinguish if a class should be loaded from db?" and the answer would be then "Check if something is an embeddable through $metadata->isEmbeddedClass" :)

@goetas
Copy link
Member

goetas commented Mar 25, 2020

ok :)

thanks!

beberlei added a commit to beberlei/doctrine2 that referenced this pull request May 12, 2020
beberlei added a commit that referenced this pull request May 12, 2020
* Revert "Fix inherited embeddables and nesting after AnnotationDriver change #8006 (#8036)"

This reverts commit a9b6b72.

* Revert "Make Embeddable not transient"

This reverts commit 58677c2.

* Housekeeping: CS fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants