eZ\Bundle\EzPublishCoreBundle\SignalSlot\Slot\SymfonyEventConverterSlot::receive PHP Method

receive() public method

Receive the given $signal and react on it.
public receive ( eZ\Publish\Core\SignalSlot\Signal $signal )
$signal eZ\Publish\Core\SignalSlot\Signal
    public function receive(Signal $signal)
    {
        $this->eventDispatcher->dispatch(MVCEvents::API_SIGNAL, new SignalEvent($signal));
    }

Usage Example

 /**
  * @covers eZ\Bundle\EzPublishCoreBundle\SignalSlot\Slot\SymfonyEventConverterSlot::__construct
  * @covers eZ\Bundle\EzPublishCoreBundle\SignalSlot\Slot\SymfonyEventConverterSlot::receive
  */
 public function testReceive()
 {
     $eventDispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $eventDispatcher->expects($this->once())->method('dispatch')->with(MVCEvents::API_SIGNAL, $this->isInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\Event\\SignalEvent'));
     $slot = new SymfonyEventConverterSlot($eventDispatcher);
     $slot->receive($this->getMock('eZ\\Publish\\Core\\SignalSlot\\Signal'));
 }
SymfonyEventConverterSlot