public function setEventDispatcher($eventDispatcher, $eventClass)
    {
        if (!is_object($eventDispatcher) || !method_exists($eventDispatcher, 'dispatch')) {
            throw new Exception('The EventDispatcher must be an object and implement a dispatch method');
        }

        $class = new \ReflectionClass($eventClass);
        if (!$class->implementsInterface('\M6Web\Bundle\AmqpBundle\Event\DispatcherInterface')) {
            throw new Exception('The Event class : '.$eventClass.' must implement DispatcherInterface');
        }

        $this->eventDispatcher = $eventDispatcher;
        $this->eventClass = $eventClass;
    }
public function setEventDispatcher($eventDispatcher, $eventClass)
    {
        if (!is_object($eventDispatcher) || !method_exists($eventDispatcher, 'dispatch')) {
            throw new Exception('The EventDispatcher must be an object and implement a dispatch method');
        }

        $class = new \ReflectionClass($eventClass);
        if (!$class->implementsInterface('\M6Web\Bundle\AmqpBundle\Event\DispatcherInterface')) {
            throw new Exception('The Event class : '.$eventClass.' must implement DispatcherInterface');
        }

        $this->eventDispatcher = $eventDispatcher;
        $this->eventClass = $eventClass;
    }
public function setEventDispatcher ( $ eventDispatcher , $ eventClass ) { if ( ! is_object ( $ eventDispatcher ) || ! method_exists ( $ eventDispatcher , 'dispatch' ) ) { throw new Exception ( 'The EventDispatcher must be an object and implement a dispatch method' ) ; } $ class = new \ ReflectionClass ( $ eventClass ) ; if ( ! $ class -> implementsInterface ( '\M6Web\Bundle\AmqpBundle\Event\DispatcherInterface' ) ) { throw new Exception ( 'The Event class : ' . $ eventClass . ' must implement DispatcherInterface' ) ; } $ this -> eventDispatcher = $ eventDispatcher ; $ this -> eventClass = $ eventClass ; }
Set an event dispatcher to notify amqp command.

@param object $eventDispatcher The eventDispatcher object, which implement the notify method
@param string $eventClass      The event class used to create an event and send it to the event dispatcher

@throws \Exception
Set an event dispatcher to notify amqp command .