-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Lifecycle callbacks on embeddables, possible or not? #6855
Labels
Comments
Not possible: an embeddable has no lifecycle on its own. The lifecycle is
the one of the entity.
…On 28 Nov 2017 18:15, "Menno Holtkamp" ***@***.***> wrote:
Encountered behaviour where embeddables seem not to respect lifecycle
callbacks, but do respect when the configuration, as also described here
<https://groups.google.com/forum/#!topic/doctrine-user/g2_vurFHEMM>.
The documentation
<http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#lifecycle-callbacks>
does not mention embeddables, so I suppose it is not supported. If so:
might be good to document this more explicitly?
The strange thing: when defining a lifecycle callback that points to a
non-existing function: an exception is thrown, so the definition *is*
respected.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6855>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakFYKpEWWtDx-Kax0ZuK9kBFhBxaZks5s7D-3gaJpZM4QtmI3>
.
|
Wow, < 1 minute response time, raspact! Should I submit a PR for the documentation on the Entity LifeCycle to explicitly indicate this will not work for embeddables? Or... is that too much 😉 . Maybe others have the same "use case". |
Sending a PR to the docs would be fab!
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
…On Tue, Nov 28, 2017 at 6:18 PM, Menno Holtkamp ***@***.***> wrote:
Wow, < 1 minute response time, raspact!
Should I submit a PR for the documentation on the Entity LifeCycle to
explicitly indicated this will not work for embeddables? Or... is that too
much ;). Maybe others have the same "use case".
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6855 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakM8rG7gIuc_pY6EsI_Ti8igNA0etks5s7EBugaJpZM4QtmI3>
.
|
This behaviour is also discussed in #4568, and can maybe be covered using https://packagist.org/packages/tarifhaus/doctrine-nullable-embeddable |
greg0ire
pushed a commit
to holtkamp/doctrine2
that referenced
this issue
Feb 17, 2020
beberlei
added a commit
to beberlei/doctrine2
that referenced
this issue
Dec 7, 2020
beberlei
added a commit
to beberlei/doctrine2
that referenced
this issue
Mar 1, 2021
…initionsOnEmbeddededClasses
beberlei
added a commit
to beberlei/doctrine2
that referenced
this issue
Mar 1, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Encountered behaviour where embeddables seem not to respect lifecycle callbacks, but do "listen" to a given configuration, as also described here.
The documentation does not mention embeddables, so I suppose it is not supported. If so: might be good to document this more explicitly?
The strange thing: when defining a lifecycle callback that points to a non-existing function: an exception is thrown, so the definition is respected.
The text was updated successfully, but these errors were encountered: