public static function discountIsValid($code)
    {
        $discount = Discount_Shortcuts_GetDiscountByCodeOrNull($code);
        if ($discount == null)
            return false;
        $engine = Discount_Shortcuts_GetEngineOrNull($discount->get_type());
        if ($engine == null)
            return false;
        return $engine->isValid($discount);
    }
public static function discountIsValid($code)
    {
        $discount = Discount_Shortcuts_GetDiscountByCodeOrNull($code);
        if ($discount == null)
            return false;
        $engine = Discount_Shortcuts_GetEngineOrNull($discount->get_type());
        if ($engine == null)
            return false;
        return $engine->isValid($discount);
    }
public static function discountIsValid ( $ code ) { $ discount = Discount_Shortcuts_GetDiscountByCodeOrNull ( $ code ) ; if ( $ discount == null ) return false ; $ engine = Discount_Shortcuts_GetEngineOrNull ( $ discount -> get_type ( ) ) ; if ( $ engine == null ) return false ; return $ engine -> isValid ( $ discount ) ; }
Checks if discount with given code is valid.

@param string $code
@return boolean
Checks if discount with given code is valid .