Closed gquemener closed 10 years ago
What do you think @docteurklein ? I agree that the kernel event dispatcher might not be the best dispatcher to use, but it's definitively better than the doctrine one.
Domain Event ftw! :horse:
Seems good to me! Just one thing, the feature suite fails on https://travis-ci.org/KnpLabs/KnpRadBundle/jobs/35732924#L1009 now.
Otherwise, here is another impl that uses no third party dispatcher :) even simpler!
https://github.com/docteurklein/event-store/blob/master/src/Knp/Event/Dispatcher.php
Indeed, it's even simpler but not as integrated within symfony as is the symfony event_dispatcher.
I'm taking a look at the build
totally right. we will benefit from its DIC integration (tags, debug command, ... ) +1
Scenarios should be fixed now.
BTW, this is a BC Break and should be tagged in a major version
awwwwesome!
it's a BC break because of the DIC tags, right?
Could it be documented in an UPGRADE file, and just make a minor release? It's not like we broke, rewrote and changed behavior. it's just its integration with DIC.
yep because of the tags. Also because Provider events now contains EventDispatcher component Event instances instead of doctrine events.
After all, if you're ok with corrent documentation, let me write it quickly!
Here it is @docteurklein :beer:
awesome! but I'd prefer a single UPGRADE.md file if possible :) I find it confusing to follow a multi-version upgrade if splitted.
you rock :)
Using doctrine event manager to dispatch domain events prevents domain event listeners to depend on doctrine (circular reference). Plus, it doesn't make much more sense to dispatch domain events through a storage layer dispatcher.
This commit allows to dispatch domain events through an event dispatcher (it uses the symfony event dispatcher by default).