PHP Class eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher

An instance of this class is required by each object that needs to send Signals.
Inheritance: extends eZ\Publish\Core\SignalSlot\SignalDispatcher
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$factory eZ\Publish\Core\SignalSlot\SlotFactory Slot factory.
$signalSlotMap array '*' signal name stands for "every signals". All slots registered to it will be triggered each time a signal is emitted.

Public Methods

Method Description
__construct ( array $signalSlotMap = [] ) Construct from factory.
attach ( string $signalIdentifier, Slot $slot ) Attaches the Slot with $slotIdentifier to the signal with $signalIdentifier.
emit ( eZ\Publish\Core\SignalSlot\Signal $signal ) Emits the given $signal.

Method Details

__construct() public method

Construct from factory.
public __construct ( array $signalSlotMap = [] )
$signalSlotMap array

attach() public method

Attaches the Slot with $slotIdentifier to the signal with $signalIdentifier.
Deprecation: pass signal slots directly to the constructor ({@see \__construct()})
public attach ( string $signalIdentifier, Slot $slot )
$signalIdentifier string
$slot eZ\Publish\Core\SignalSlot\Slot

emit() public method

All assigned slots will eventually receive the $signal
public emit ( eZ\Publish\Core\SignalSlot\Signal $signal )
$signal eZ\Publish\Core\SignalSlot\Signal

Property Details

$factory protected property

Slot factory.
protected SlotFactory,eZ\Publish\Core\SignalSlot $factory
return eZ\Publish\Core\SignalSlot\SlotFactory

$signalSlotMap protected property

'*' signal name stands for "every signals". All slots registered to it will be triggered each time a signal is emitted.
protected array $signalSlotMap
return array