% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::pkg_class - Object methods for pkg_class records
use FS::pkg_class;
$record = new FS::pkg_class \%hash;
$record = new FS::pkg_class { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
An FS::pkg_class object represents an package class. Every package definition (see FS::part_pkg) has, optionally, a package class. FS::pkg_class inherits from FS::Record. The following fields are currently supported:
primary key (assigned automatically for new package classes)
Text name of this package class
Number of associated pkg_category (see FS::pkg_category)
Disabled flag, empty or 'Y'
Creates a new package class. To add the package class to the database, see "insert".
Adds this package class to the database. If there is an error, returns the error, otherwise returns false.
Deletes this package class from the database. Only package classes with no associated package definitions can be deleted. If there is an error, returns the error, otherwise returns false.
Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid package class. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the pkg_category record associated with this class, or false if there is none.
Returns the category name associated with this class, or false if there is none.