Difference between revisions of "Freeside:4:Documentation:Developer/FS/cust class"
From Freeside
(Edit via perl MediaWiki framework (1.13)) |
(No difference)
|
Latest revision as of 07:19, 18 November 2015
Contents
NAME
FS::cust_class - Object methods for cust_class records
SYNOPSIS
use FS::cust_class; $record = new FS::cust_class \%hash; $record = new FS::cust_class { 'column' => 'value' }; $error = $record->insert; $error = $new_record->replace($old_record); $error = $record->delete; $error = $record->check;
DESCRIPTION
An FS::pkg_class object represents an customer class. Every customer (see FS::cust_main) has, optionally, a customer class. FS::cust_class inherits from FS::Record. The following fields are currently supported:
- classnum
- primary key
- classname
- Text name of this customer class
- categorynum
- Number of associated cust_category (see FS::cust_category)
- tax
- Tax exempt flag, empty or 'Y'. Used when the cust_class-tax_exempt configuration setting is turned on.
- disabled
- Disabled flag, empty or 'Y'
METHODS
- new HASHREF
- Creates a new customer class. To add the customer class to the database, see "insert".
- insert
- Adds this customer class to the database. If there is an error, returns the error, otherwise returns false.
- delete
- Delete this customer class from the database. Only customer classes with no associated customers can be deleted. If there is an error, returns the error, otherwise returns false.
- replace [ OLD_RECORD ]
- Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
- check
- Checks all fields to make sure this is a valid customer class. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- cust_category
- Returns the cust_category record associated with this class, or false if there is none.
- categoryname
- Returns the category name associated with this class, or false if there is none.