X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcgp_rule_condition.pm;h=772e1899ec1fec0d0153beb2927660a437d59394;hp=a8b7e560c16d51b028a7bfc0de98ae1089c7152b;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=3a201934245c2e72b167804a6d512e0e6d435f65 diff --git a/FS/FS/cgp_rule_condition.pm b/FS/FS/cgp_rule_condition.pm index a8b7e560c..772e1899e 100644 --- a/FS/FS/cgp_rule_condition.pm +++ b/FS/FS/cgp_rule_condition.pm @@ -3,6 +3,7 @@ package FS::cgp_rule_condition; use strict; use base qw( FS::Record ); use FS::Record qw( qsearch qsearchs ); +use FS::cgp_rule; =head1 NAME @@ -25,8 +26,9 @@ FS::cgp_rule_condition - Object methods for cgp_rule_condition records =head1 DESCRIPTION -An FS::cgp_rule_condition object represents an example. FS::cgp_rule_condition inherits from -FS::Record. The following fields are currently supported: +An FS::cgp_rule_condition object represents a mail filtering condition. +FS::cgp_rule_condition inherits from FS::Record. The following fields are +currently supported: =over 4 @@ -34,7 +36,7 @@ FS::Record. The following fields are currently supported: primary key -=item condition +=item conditionname condition @@ -50,7 +52,6 @@ params rulenum - =back =head1 METHODS @@ -59,7 +60,7 @@ rulenum =item new HASHREF -Creates a new example. To add the example to the database, see L<"insert">. +Creates a new condition. To add the condition 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 method. @@ -98,7 +99,7 @@ returns the error, otherwise returns false. =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 condition. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods. @@ -112,22 +113,31 @@ sub check { my $error = $self->ut_numbern('ruleconditionnum') - || $self->ut_text('condition') - || $self->ut_text('op') - || $self->ut_text('params') - || $self->ut_number('rulenum') + || $self->ut_text('conditionname') + || $self->ut_textn('op') + || $self->ut_textn('params') + || $self->ut_foreign_key('rulenum', 'cgp_rule', 'rulenum') ; return $error if $error; $self->SUPER::check; } +=item arrayref + +Returns an array reference of the conditionname, op and params fields. + +=cut + +sub arrayref { + my $self = shift; + [ map $self->$_, qw( conditionname op params ) ]; +} + =back =head1 BUGS -The author forgot to customize this manpage. - =head1 SEE ALSO L, schema.html from the base documentation.