DDC-412: YAML can't handle multiple lifecycle events with one method #4905

doctrinebot opened this Issue Mar 11, 2010 · 6 comments

2 participants


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.


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.


Comment created by @beberlei:

this wouldnt allow multiple methods per event.


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}


{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?


Comment created by @beberlei:



Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment