public function execute(Command $command)
    {
        if (!$this->innerCommandBus) {
            throw new Exception('No inner bus defined for this decorator. Set an inner bus with setInnerBus()');
        }

        $response = $this->innerCommandBus->execute($command);

        $eventName = $this->getEventName($command);

        $this->dispatcher->dispatch($eventName, [$command]);

        return $response;
    }
public function execute(Command $command)
    {
        if (!$this->innerCommandBus) {
            throw new Exception('No inner bus defined for this decorator. Set an inner bus with setInnerBus()');
        }

        $response = $this->innerCommandBus->execute($command);

        $eventName = $this->getEventName($command);

        $this->dispatcher->dispatch($eventName, [$command]);

        return $response;
    }
public function execute ( Command $ command ) { if ( ! $ this -> innerCommandBus ) { throw new Exception ( 'No inner bus defined for this decorator. Set an inner bus with setInnerBus()' ) ; } $ response = $ this -> innerCommandBus -> execute ( $ command ) ; $ eventName = $ this -> getEventName ( $ command ) ; $ this -> dispatcher -> dispatch ( $ eventName , [ $ command ] ) ; return $ response ; }
Execute a command and dispatch and event

@param Command $command
@return mixed
@throws \Exception
Execute a command and dispatch and event