static public function isValidTrigger($trigger, $throwException = true)
    {
        if (in_array($trigger, static::getTriggers(), true)) {
            return true;
        }

        if ($throwException) {
            throw new InvalidArgumentException("Invalid payment term trigger '$trigger'.");
        }

        return false;
    }
static public function isValidTrigger($trigger, $throwException = true)
    {
        if (in_array($trigger, static::getTriggers(), true)) {
            return true;
        }

        if ($throwException) {
            throw new InvalidArgumentException("Invalid payment term trigger '$trigger'.");
        }

        return false;
    }
Returns whether or not the given trigger is valid.

@param string $trigger
@param bool   $throwException

@return bool