% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::cgp_rule - Object methods for cgp_rule records
use FS::cgp_rule;
$record = new FS::cgp_rule \%hash;
$record = new FS::cgp_rule { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::cgp_rule object represents a mail filtering rule. FS::cgp_rule inherits from FS::Record. The following fields are currently supported:
Creates a new rule. To add the rule to the database, see "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 hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Calls the replace export for any communigate exports attached to this rule's service.
Checks all fields to make sure this is a valid rule. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Clones this rule into an identical rule for the specified new service.
If there is an error, returns the error, otherwise returns false.
Returns the conditions associated with this rule, as FS::cgp_rule_condition objects.
Returns the actions associated with this rule, as FS::cgp_rule_action objects.
Returns an arraref representing this rule, suitable for Communigate Pro API commands:
The first element specifies the rule priority.
The second element specifies the rule name.
The third element specifies the rule conditions.
The fourth element specifies the rule actions.
The fifth element specifies the rule comment.
FS::Record, schema.html from the base documentation.