4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::cgp_rule - Object methods for cgp_rule records
15 $record = new FS::cgp_rule \%hash;
16 $record = new FS::cgp_rule { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::cgp_rule object represents an example. FS::cgp_rule inherits from
29 FS::Record. The following fields are currently supported:
62 Creates a new example. To add the example to the database, see L<"insert">.
64 Note that this stores the hash reference, not a distinct copy of the hash it
65 points to. You can ask the object for a copy with the I<hash> method.
69 # the new method can be inherited from FS::Record, if a table method is defined
71 sub table { 'cgp_rule'; }
75 Adds this record to the database. If there is an error, returns the error,
76 otherwise returns false.
80 # the insert method can be inherited from FS::Record
84 Delete this record from the database.
88 # the delete method can be inherited from FS::Record
90 =item replace OLD_RECORD
92 Replaces the OLD_RECORD with this one in the database. If there is an error,
93 returns the error, otherwise returns false.
97 # the replace method can be inherited from FS::Record
101 Checks all fields to make sure this is a valid example. If there is
102 an error, returns the error, otherwise returns false. Called by the insert
107 # the check method should currently be supplied - FS::Record contains some
108 # data checking routines
114 $self->ut_numbern('rulenum')
115 || $self->ut_text('name')
116 || $self->ut_text('comment')
117 || $self->ut_number('svcnum')
118 || $self->ut_number('priority')
120 return $error if $error;
129 The author forgot to customize this manpage.
133 L<FS::Record>, schema.html from the base documentation.