Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/pkg class"
From Freeside
(import from POD) |
m (Edit via perl MediaWiki framework (1.13)) |
||
Line 20: | Line 20: | ||
An FS::pkg_class object represents an package class. Every package definition (see [[Freeside:1.9:Documentation:Developer/FS/part pkg|FS::part_pkg]]) has, optionally, a package class. FS::pkg_class inherits from FS::Record. The following fields are currently supported: | An FS::pkg_class object represents an package class. Every package definition (see [[Freeside:1.9:Documentation:Developer/FS/part pkg|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; disabled - Disabled flag, empty or 'Y' | + | ; classnum - primary key (assigned automatically for new package classes); classname - Text name of this package class; categorynum - Number of associated pkg_category (see [[Freeside:1.9:Documentation:Developer/FS/pkg category|FS::pkg_category]]); disabled - Disabled flag, empty or 'Y' |
==METHODS== | ==METHODS== | ||
; new HASHREF | ; new HASHREF | ||
Line 32: | Line 32: | ||
; check | ; 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. | :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== | ==BUGS== | ||
==SEE ALSO== | ==SEE ALSO== | ||
[[Freeside:1.9:Documentation:Developer/FS/Record|FS::Record]], [[Freeside:1.9:Documentation:Developer/FS/part pkg|FS::part_pkg]], schema.html from the base documentation. | [[Freeside:1.9:Documentation:Developer/FS/Record|FS::Record]], [[Freeside:1.9:Documentation:Developer/FS/part pkg|FS::part_pkg]], schema.html from the base documentation. |
Latest revision as of 17:15, 6 February 2009
Contents
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.