public function createCommand($event) {
        if (!empty($this->commands[$event->name])) {
            if (is_callable($this->condition) && call_user_func($this->condition, $this->owner) === false) {
                return;
            }
            $class = $this->commands[$event->name];
            $command = new $class();
            if (($command instanceof CommandInterface) === false) {
                throw new InvalidParamException('Class name [' . get_class($class) . '] provided in "commands" param MUST implement the jlorente\command\base\CommandInterface interface');
            }
            $command->setReceiver($this->owner);
            CommandMapper::map($command);
        }
    }
public function createCommand($event) {
        if (!empty($this->commands[$event->name])) {
            if (is_callable($this->condition) && call_user_func($this->condition, $this->owner) === false) {
                return;
            }
            $class = $this->commands[$event->name];
            $command = new $class();
            if (($command instanceof CommandInterface) === false) {
                throw new InvalidParamException('Class name [' . get_class($class) . '] provided in "commands" param MUST implement the jlorente\command\base\CommandInterface interface');
            }
            $command->setReceiver($this->owner);
            CommandMapper::map($command);
        }
    }
public function createCommand ( $ event ) { if ( ! empty ( $ this -> commands [ $ event -> name ] ) ) { if ( is_callable ( $ this -> condition ) && call_user_func ( $ this -> condition , $ this -> owner ) === false ) { return ; } $ class = $ this -> commands [ $ event -> name ] ; $ command = new $ class ( ) ; if ( ( $ command instanceof CommandInterface ) === false ) { throw new InvalidParamException ( 'Class name [' . get_class ( $ class ) . '] provided in "commands" param MUST implement the jlorente\command\base\CommandInterface interface' ) ; } $ command -> setReceiver ( $ this -> owner ) ; CommandMapper :: map ( $ command ) ; } }
Generates and stores the Command object depending on the triggered event.

@param Event $event
Generates and stores the Command object depending on the triggered event .