eZPublishCommunityProject  2013.9
eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher Class Reference

Dispatches Signals to their assigned Slots. More...

+ Inheritance diagram for eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher:
+ Collaboration diagram for eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher:

Public Member Functions

 __construct (SlotFactory $factory, array $mapping=array())
 Construct from factory. More...
 
 attach ($signalIdentifier, $slotIdentifier)
 Attaches the Slot with $slotIdentifier to the signal with $signalIdentifier. More...
 
 emit (Signal $signal)
 Emits the given $signal. More...
 
- Public Member Functions inherited from eZ\Publish\Core\SignalSlot\SignalDispatcher
 attach ($signalIdentifier, $slotIdentifier)
 Attaches the Slot with $slotIdentifier to the signal with $signalIdentifier. More...
 
 emit (Signal $signal)
 Emits the given $signal. More...
 

Public Attributes

const RELATIVE_SIGNAL_NAMESPACE = 'eZ\\Publish\\Core\\SignalSlot\\Signal'
 Relative namespace for internal signals. More...
 

Protected Attributes

 $factory
 
 $mapping = array()
 

Detailed Description

Dispatches Signals to their assigned Slots.

An instance of this class is required by each object that needs to send Signals. It is recommended, that a SignalDispatcher works together with a SlotFactory to get hold of the actual Slots that listen for a given Signal, which it originally only knows by their identifier.

Constructor & Destructor Documentation

eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::__construct ( SlotFactory  $factory,
array  $mapping = array() 
)

Construct from factory.

Parameters
\eZ\Publish\Core\SignalSlot\SlotFactory$factory
array$mapping

Member Function Documentation

eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::attach (   $signalIdentifier,
  $slotIdentifier 
)

Attaches the Slot with $slotIdentifier to the signal with $signalIdentifier.

private For unit test use.

Parameters
string$signalIdentifier
string$slotIdentifier
eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::emit ( Signal  $signal)

Emits the given $signal.

All assigned slots will eventually receive the $signal

Parameters
Signal$signal
Returns
void

Member Data Documentation

eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::$factory
protected
eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::$mapping = array()
protected
const eZ\Publish\Core\SignalSlot\SignalDispatcher\DefaultSignalDispatcher::RELATIVE_SIGNAL_NAMESPACE = 'eZ\\Publish\\Core\\SignalSlot\\Signal'

Relative namespace for internal signals.


The documentation for this class was generated from the following file: