mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Lifecycle callbacks on embeddables, possible or not? #5788
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 @holtkamp on GitHub (Nov 28, 2017).
Originally assigned to: @holtkamp on GitHub.
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.
@Ocramius commented on GitHub (Nov 28, 2017):
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" notifications@github.com wrote:
@holtkamp commented on GitHub (Nov 28, 2017):
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".
@Ocramius commented on GitHub (Nov 28, 2017):
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 notifications@github.com
wrote:
@holtkamp commented on GitHub (May 18, 2018):
This behaviour is also discussed in https://github.com/doctrine/doctrine2/issues/4568, and can maybe be covered using https://packagist.org/packages/tarifhaus/doctrine-nullable-embeddable