Dispatcher
class Dispatcher (View source)
A dispatcher which dispatches signals by calling its registered slot methods and passing them the method arguments which were originally passed to the signal method.
Properties
protected ObjectManagerInterface | $objectManager | ||
protected array | $slots | Information about all slots connected a certain signal. |
Methods
Connects a signal with a slot.
Connects a signal with a slot.
Dispatches a signal by calling the registered Slot methods
Returns all slots which are connected with the given signal
Returns all signals with its slots
Details
void
injectObjectManager(ObjectManagerInterface $objectManager)
Injects the object manager
void
connect(string $signalClassName, string $signalName, mixed $slotClassNameOrObject, string $slotMethodName = '', bool $passSignalInformation = true)
Connects a signal with a slot.
One slot can be connected with multiple signals by calling this method multiple times.
When $passSignalInformation is true, the slot will be passed a string (EmitterClassName::signalName) as the last parameter.
void
wire(string $signalClassName, string $signalName, mixed $slotClassNameOrObject, string $slotMethodName = '')
Connects a signal with a slot.
One slot can be connected with multiple signals by calling this method multiple times.
The slot will be passed a an instance of SignalInformation as the sole parameter.
void
dispatch(string $signalClassName, string $signalName, array $signalArguments = [])
Dispatches a signal by calling the registered Slot methods
array
getSlots(string $signalClassName, string $signalName)
Returns all slots which are connected with the given signal
array
getSignals()
Returns all signals with its slots