1 package FS::discount_class;
2 use base qw( FS::class_Common );
5 use FS::Record qw( qsearch qsearchs );
9 FS::discount_class - Object methods for discount_class records
13 use FS::discount_class;
15 $record = new FS::discount_class \%hash;
16 $record = new FS::discount_class { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::discount_class object represents a discount class. FS::discount_class
29 inherits from FS::Record. The following fields are currently supported:
53 Creates a new discount class. To add the discount class to the database, see
56 Note that this stores the hash reference, not a distinct copy of the hash it
57 points to. You can ask the object for a copy with the I<hash> method.
61 sub table { 'discount_class'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 Delete this record from the database.
72 =item replace OLD_RECORD
74 Replaces the OLD_RECORD with this one in the database. If there is an error,
75 returns the error, otherwise returns false.
79 Checks all fields to make sure this is a valid discount class. If there is
80 an error, returns the error, otherwise returns false. Called by the insert
89 $self->ut_numbern('classnum')
90 || $self->ut_text('classname')
91 || $self->ut_enum('disabled', [ '', 'Y' ])
93 return $error if $error;
104 L<FS::discount>, L<FS::Record>, schema.html from the base documentation.