final public function handle(CommandInterface $command)
    {
        $this->validateCommand($command);

        try {
            // @todo - Update this to return the succes event object, rather than using the getSuccessEvent() method
            $this->_handle($command);
        } catch (\Exception $exception) {

            // Log exception
            $commandClass = get_class($command);
            $this->logError(
                "Exception throw while handling {$commandClass} command... {$exception->getMessage()}\n",
                $exception
            );

            // Fire failure event
            $this->emit($this->getFailureEvent($exception));

            throw $exception;
        }

        $event = $this->getSuccessEvent($command);
        $this->emit($event);
    }
final public function handle(CommandInterface $command)
    {
        $this->validateCommand($command);

        try {
            // @todo - Update this to return the succes event object, rather than using the getSuccessEvent() method
            $this->_handle($command);
        } catch (\Exception $exception) {

            // Log exception
            $commandClass = get_class($command);
            $this->logError(
                "Exception throw while handling {$commandClass} command... {$exception->getMessage()}\n",
                $exception
            );

            // Fire failure event
            $this->emit($this->getFailureEvent($exception));

            throw $exception;
        }

        $event = $this->getSuccessEvent($command);
        $this->emit($event);
    }
final public function handle ( CommandInterface $ command ) { $ this -> validateCommand ( $ command ) ; try { // @todo - Update this to return the succes event object, rather than using the getSuccessEvent() method $ this -> _handle ( $ command ) ; } catch ( \ Exception $ exception ) { // Log exception $ commandClass = get_class ( $ command ) ; $ this -> logError ( "Exception throw while handling {$commandClass} command... {$exception->getMessage()}\n" , $ exception ) ; // Fire failure event $ this -> emit ( $ this -> getFailureEvent ( $ exception ) ) ; throw $ exception ; } $ event = $ this -> getSuccessEvent ( $ command ) ; $ this -> emit ( $ event ) ; }
Processes the associated command

@param CommandInterface $command

@return void

@throws \Exception if _handler() throws an error
Processes the associated command