PHP Class Neos\Flow\SignalSlot\Dispatcher

Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$slots array Indexed by [$signalClassName][$signalMethodName] and then numeric with an array of information about the slot

Public Methods

Method Description
connect ( string $signalClassName, string $signalName, mixed $slotClassNameOrObject, string $slotMethodName = '', boolean $passSignalInformation = true ) : void Connects a signal with a slot.
dispatch ( string $signalClassName, string $signalName, array $signalArguments = [] ) : void Dispatches a signal by calling the registered Slot methods
getSignals ( ) : array Returns all signals with its slots
getSlots ( string $signalClassName, string $signalName ) : array Returns all slots which are connected with the given signal
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void Injects the object manager

Method Details

connect() public method

One slot can be connected with multiple signals by calling this method multiple times.
public connect ( string $signalClassName, string $signalName, mixed $slotClassNameOrObject, string $slotMethodName = '', boolean $passSignalInformation = true ) : void
$signalClassName string Name of the class containing the signal
$signalName string Name of the signal
$slotClassNameOrObject mixed Name of the class containing the slot or the instantiated class or a Closure object
$slotMethodName string Name of the method to be used as a slot. If $slotClassNameOrObject is a Closure object, this parameter is ignored
$passSignalInformation boolean If set to TRUE, the last argument passed to the slot will be information about the signal (EmitterClassName::signalName)
return void

dispatch() public method

Dispatches a signal by calling the registered Slot methods
public dispatch ( string $signalClassName, string $signalName, array $signalArguments = [] ) : void
$signalClassName string Name of the class containing the signal
$signalName string Name of the signal
$signalArguments array arguments passed to the signal method
return void

getSignals() public method

Returns all signals with its slots
public getSignals ( ) : array
return array An array of arrays with slot information

getSlots() public method

Returns all slots which are connected with the given signal
public getSlots ( string $signalClassName, string $signalName ) : array
$signalClassName string Name of the class containing the signal
$signalName string Name of the signal
return array An array of arrays with slot information

injectObjectManager() public method

Injects the object manager
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
return void

Property Details

$objectManager protected property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$slots protected property

Indexed by [$signalClassName][$signalMethodName] and then numeric with an array of information about the slot
protected array $slots
return array