use strict;
use base qw( FS::Record );
use FS::Record qw( qsearch qsearchs );
+use FS::cgp_rule;
=head1 NAME
=head1 DESCRIPTION
-An FS::cgp_rule_action object represents an example. FS::cgp_rule_action inherits from
-FS::Record. The following fields are currently supported:
+An FS::cgp_rule_action object represents a mail filtering action.
+FS::cgp_rule_action inherits from FS::Record. The following fields are
+currently supported:
=over 4
rulenum
-
=back
=head1 METHODS
=item new HASHREF
-Creates a new example. To add the example to the database, see L<"insert">.
+Creates a new action. To add the action to the database, see L<"insert">.
Note that this stores the hash reference, not a distinct copy of the hash it
points to. You can ask the object for a copy with the I<hash> method.
=item check
-Checks all fields to make sure this is a valid example. If there is
+Checks all fields to make sure this is a valid action. If there is
an error, returns the error, otherwise returns false. Called by the insert
and replace methods.
my $error =
$self->ut_numbern('ruleactionnum')
|| $self->ut_text('action')
- || $self->ut_text('params')
- || $self->ut_number('rulenum')
+ || $self->ut_textn('params')
+ || $self->ut_foreign_key('rulenum', 'cgp_rule', 'rulenum')
;
return $error if $error;
$self->SUPER::check;
}
+=item arrayref
+
+=cut
+
+sub arrayref {
+ my $self = shift;
+ [ $self->action, $self->params ];
+}
+
=back
=head1 BUGS
-The author forgot to customize this manpage.
-
=head1 SEE ALSO
L<FS::Record>, schema.html from the base documentation.