Freeside:1.9:Documentation:Developer/FS/pkg class

From Freeside
Jump to: navigation, search

NAME

FS::pkg_class - Object methods for pkg_class records

SYNOPSIS

 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;

DESCRIPTION

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:

classnum - primary key (assigned automatically for new package classes); classname - Text name of this package class; categorynum - Number of associated pkg_category (see FS::pkg_category); disabled - Disabled flag, empty or 'Y'

METHODS

new HASHREF
Creates a new package class. To add the package class to the database, see "insert".
insert
Adds this package class to the database. If there is an error, returns the error, otherwise returns false.
delete
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.
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 package class. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
pkg_category
Returns the pkg_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.

BUGS

SEE ALSO

FS::Record, FS::part_pkg, schema.html from the base documentation.