Freeside:4:Documentation:Developer/FS/cgp rule

From Freeside
Jump to: navigation, search

NAME

FS::cgp_rule - Object methods for cgp_rule records

SYNOPSIS

 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;

DESCRIPTION

An FS::cgp_rule object represents a mail filtering rule. FS::cgp_rule inherits from FS::Record. The following fields are currently supported:

rulenum
primary key
name
name
comment
comment
svcnum
svcnum
priority
priority

METHODS

new HASHREF
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.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
svc_export
Calls the replace export for any communigate exports attached to this rule's service.
check
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.
clone NEW_SVCNUM
Clones this rule into an identical rule for the specified new service.
If there is an error, returns the error, otherwise returns false.
cust_svc; cgp_rule_condition
Returns the conditions associated with this rule, as FS::cgp_rule_condition objects.
arrayref
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.

BUGS

SEE ALSO

FS::Record, schema.html from the base documentation.