mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-412: YAML can't handle multiple lifecycle events with one method #514
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 @doctrinebot on GitHub (Mar 11, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user @beberlei:
YAML uses the method as key and therefore can only register one lifecycle event per method. Annotations and XML dont have this limitation.
@doctrinebot commented on GitHub (Mar 11, 2010):
Comment created by shurakai:
I think we should simply flip the order in line 383 (instead of method => type use type => method). One would have to use
prePersist: doSomethingOnPrePersist
in that case. This should be easy enough to fix.
Remember to change documentation if this fix is accepted.
@doctrinebot commented on GitHub (Mar 12, 2010):
Comment created by @beberlei:
this wouldnt allow multiple methods per event.
@doctrinebot commented on GitHub (Mar 14, 2010):
Comment created by shurakai:
Benjamin, I got you wrong the first time - sorry. I've attached a patch and some tests that should fix this issue. The test also affects other drivers so the mapping files needed updating too.
Please make sure to update your models accordingly:
Former syntax:
{quote} methodname: lifecycle{quote}
now:
{quote} lifecycle: [ method ]{quote}
Multiple methods:
{quote} lifecycle: [ method1, method2 ]{quote}
This should also be noted in the docs and especially in the upgrade instructions from Alpha4 to Beta1. Could you please take care of that?
@doctrinebot commented on GitHub (Mar 15, 2010):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Mar 15, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/092f3d72badf2d6316b6