)";
}
+#c.f. part_event_condition_option.pm / part_event_condition_option_option
+#used for part_event/Condition/payby.pm
+sub condition_sql_option_option {
+ my( $class, $option ) = @_;
+
+ ( my $condname = $class ) =~ s/^.*:://;
+
+ my $optionnum =
+ "( SELECT optionnum FROM part_event_condition_option
+ WHERE part_event_condition_option.eventconditionnum =
+ cond_$condname.eventconditionnum
+ AND part_event_condition_option.optionname = '$option'
+ AND part_event_condition_option.optionvalue = 'HASH'
+ )";
+
+ "( SELECT optionname FROM part_event_condition_option_option
+ WHERE optionnum = $optionnum
+ )";
+
+}
+
+
=item condition_sql_option_age_from OPTION FROM_TIMESTAMP
This is a class method that returns an SQL fragment that will retreive a
}
+=item condition_sql_option_integer
+
+As I<condition_sql_option>, but cast the option value to an integer so that
+comparison to other integers is type-correct.
+
+=cut
+
+sub condition_sql_option_integer {
+ my ($class, $option) = @_;
+ 'CAST ('.$class->condition_sql_option($option).' AS INTEGER)';
+}
+
=head1 NEW CONDITION CLASSES
A module should be added in FS/FS/part_event/Condition/ which implements the