public function run($n = null, $restoreErroneousMappers = true) {
        if ($n !== null && is_numeric($n) === false) {
            throw new InvalidParamException('n must be a numeric value');
        }
        $i = 0;
        while (($n === null || $i++ < $n) && ($mapper = CommandMapper::find()->orderBy($this->getOrder())->one())) {
            $this->processMapper($mapper);
        }
        if ($this->hasErroneousMappers()) {
            if ($restoreErroneousMappers) {
                $this->restoreErroneousMappers();
            }
            return false;
        } else {
            return $i;
        }
    }