5.1.1.1. Baleen\Migrations\Event\CanDispatchEventsTrait

trait CanDispatchEventsTrait

Allows classes to OPTIONALLY receive an EventDispatcher to dispatch events. Making it optional puts responsibility on the implementation: if the EventDispatcher is not available then no events are dispatched.

property eventDispatcher

protected null|EventDispatcherInterface

getEventDispatcher()
Returns:null|EventDispatcherInterface
setEventDispatcher(EventDispatcherInterface $eventDispatcher)
Parameters:
  • $eventDispatcher (EventDispatcherInterface) –
dispatchEvent($name, Event $event)

Dispatches an event if an EventDispatcher is available.

Parameters:
  • $name
  • $event (Event) –
Returns:

Event