Domain Events

Domain Event listeners have to be configured before the Application Service gets executed, or nobody will be noticed. There are situations where you'll have to be explicit and configure the listener before executing the Application Service:

// ...
$subscriber = new SpySubscriber();
DomainEventPublisher::instance()->subscribe($subscriber);

$applicationService = // ...
$applicationService->execute(...);

Most of the time, this will be done by configuring the Dependency Injection Container.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset