mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #420] Cascade dependent identities to associations #8166
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?
Original Pull Request: https://github.com/doctrine/orm/pull/420
State: closed
Merged: No
Currently when an entity in a one-to-one association gets its identity from another entity it requires calling the setter for the associated entity from the setter in the identity source entity setter or passing the identity source entity to the associated entity's constructer, something similar to this:
This PR adds checks for associations with cascade persist that have dependent identities which are empty, and sets the field in the associated entity to the identity source entity. Granted it's not complicated to do as the previous example, but this allows for simpler code. It also seems a logical assumption that when the association is cascade persist this should happen automatically:
Now only if it wasn't so wordy to explain :)