1 package FS::cgp_rule_action;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
10 FS::cgp_rule_action - Object methods for cgp_rule_action records
14 use FS::cgp_rule_action;
16 $record = new FS::cgp_rule_action \%hash;
17 $record = new FS::cgp_rule_action { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::cgp_rule_action object represents a mail filtering action.
30 FS::cgp_rule_action inherits from FS::Record. The following fields are
59 Creates a new action. To add the action to the database, see L<"insert">.
61 Note that this stores the hash reference, not a distinct copy of the hash it
62 points to. You can ask the object for a copy with the I<hash> method.
66 # the new method can be inherited from FS::Record, if a table method is defined
68 sub table { 'cgp_rule_action'; }
72 Adds this record to the database. If there is an error, returns the error,
73 otherwise returns false.
77 # the insert method can be inherited from FS::Record
81 Delete this record from the database.
85 # the delete method can be inherited from FS::Record
87 =item replace OLD_RECORD
89 Replaces the OLD_RECORD with this one in the database. If there is an error,
90 returns the error, otherwise returns false.
94 # the replace method can be inherited from FS::Record
98 Checks all fields to make sure this is a valid action. If there is
99 an error, returns the error, otherwise returns false. Called by the insert
104 # the check method should currently be supplied - FS::Record contains some
105 # data checking routines
111 $self->ut_numbern('ruleactionnum')
112 || $self->ut_text('action')
113 || $self->ut_textn('params')
114 || $self->ut_foreign_key('rulenum', 'cgp_rule', 'rulenum')
116 return $error if $error;
127 [ $self->action, $self->params ];
136 L<FS::Record>, schema.html from the base documentation.