Skip to content

Conversation

lsmith77
Copy link
Member

@lsmith77 lsmith77 commented Oct 6, 2014

supersedes #571
fixes #569

@lsmith77
Copy link
Member Author

lsmith77 commented Oct 6, 2014

ping @ElectricMaxxx / @dbu

@ElectricMaxxx
Copy link
Contributor

Look good, do have to do something in my branch as you extended mine? Or do you merge them together?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can get rid of suppressEvents now i think. a new translation can also be created when flushing, and it should make no difference for the event.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand, the method is still being called in cases when the translation already has been bound. One thing that concerns me with the new name is that the event is actually triggered when the translation is bound for the first time. it does not necessarily need to be stored.

Maybe a better name would be pre-/postInitialBindTranslation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups, i should have read the line above, thought you still pass the $suppressEvents into the method. of course, we only want the event on a new translation. maybe s/$suppressEvents/$new ? and if ($new && ...)?

we can go with InitialBindTranslation as name, yes. actually, could it just be one initialBindTranslation event, no pre/post? if you want to change content, you could use prePersist/preUpdate. so this event would just be to track that a translation is being added.
or maybe call it preCreateTranslation and if somebody needs a "real" postCreateTranslation that happens after the flush, he can add that with some sort of queue.

sorry to throw in different ideas here, but if we break things we should figure out what the right scenario is.

makes me wonder if we can somehow postpone this to 1.3 to not block the release. but i guess the problem is that with the refactorings, we have to do something and have a minor BC break of some sort anyways.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no .. we cannot postpone it as the behavior is already changed so better break BC here only once.
regarding only a single event. not sure. right now at least all events are a pre/post combo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as pre and post happen within the same method, they are not a very useful distinction here, thats why i thought about just one of them.

my suggestion would be to only do the preCreateTranslation now and doing no postCreate at all rather than one with a flawed semantics and then need another BC break when fixing that. once needed, a proper postCreateTranslation can be done - if we do it now doing the right thing will become harder.

@lsmith77 lsmith77 force-pushed the rename_bind_trans_event branch 2 times, most recently from c9354a8 to d708463 Compare October 7, 2014 07:22
@lsmith77 lsmith77 force-pushed the rename_bind_trans_event branch from d708463 to 554598f Compare October 7, 2014 09:28
@lsmith77 lsmith77 changed the title replaced pre/postBindTranslation events with pre/postCreateTranslation replaced pre/postBindTranslation events with a postCreateTranslation Oct 7, 2014
@lsmith77
Copy link
Member Author

lsmith77 commented Oct 7, 2014

@dbu: please review

@dbu
Copy link
Member

dbu commented Oct 7, 2014

i am +1 on this. @ElectricMaxxx ok with this? the reasoning is that the postCreate should happen after the stuff is flushed, but that would be completely new so we just as well let that to whoever needs that event (if ever).

@lsmith77
Copy link
Member Author

lsmith77 commented Oct 7, 2014

ok .. merging .. as I want to release.

lsmith77 added a commit that referenced this pull request Oct 7, 2014
replaced pre/postBindTranslation events with a postCreateTranslation
@lsmith77 lsmith77 merged commit e08f80f into master Oct 7, 2014
@lsmith77 lsmith77 deleted the rename_bind_trans_event branch October 7, 2014 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clarify translation event
3 participants