1 package FS::cust_class;
4 use base qw( FS::class_Common );
10 FS::cust_class - Object methods for cust_class records
16 $record = new FS::cust_class \%hash;
17 $record = new FS::cust_class { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::pkg_class object represents an customer class. Every customer (see
30 L<FS::cust_main>) has, optionally, a customer class. FS::cust_class inherits
31 from FS::Record. The following fields are currently supported:
41 Text name of this customer class
45 Number of associated cust_category (see L<FS::cust_category>)
49 Disabled flag, empty or 'Y'
59 Creates a new customer class. To add the customer class to the database, see
64 sub table { 'cust_class'; }
65 sub _target_table { 'cust_main'; }
69 Adds this customer class to the database. If there is an error, returns the
70 error, otherwise returns false.
74 Delete this customer class from the database. Only customer classes with no
75 associated customers can be deleted. If there is an error, returns
76 the error, otherwise returns false.
78 =item replace [ OLD_RECORD ]
80 Replaces OLD_RECORD with this one in the database. If there is an error,
81 returns the error, otherwise returns false.
85 Checks all fields to make sure this is a valid customer class. If there is
86 an error, returns the error, otherwise returns false. Called by the insert
93 Returns the cust_category record associated with this class, or false if there
105 Returns the category name associated with this class, or false if there
116 L<FS::cust_main>, L<FS::Record>