Difference between revisions of "Freeside:3:Documentation:Developer/FS/class Common"
From Freeside
m (Edit via perl MediaWiki framework (1.13)) |
m (Edit via perl MediaWiki framework (1.13)) |
||
Line 1: | Line 1: | ||
+ | ==NAME== | ||
+ | FS::class_Common - Base class for classification classes | ||
+ | ==SYNOPSIS== | ||
+ | use base qw( FS::class_Common ); use FS::category_table; #should use this | ||
+ | |||
+ | #required sub _target_table { 'table_name'; } | ||
+ | |||
+ | #optional for non-standard names sub _target_column { 'classnum'; } #default is classnum sub _category_table { 'table_name'; } #default is to replace s/class/category/ | ||
+ | |||
+ | ==DESCRIPTION== | ||
+ | FS::class_Common is a base class for classes which provide a classification for other classes, such as pkg_class or cust_class. | ||
+ | |||
+ | ==METHODS== | ||
+ | ; new HASHREF | ||
+ | :Creates a new classification. To add the classfication to the database, see [[#insert|"insert"]]. | ||
+ | ; insert | ||
+ | :Adds this classification to the database. If there is an error, returns the error, otherwise returns false. | ||
+ | ; delete | ||
+ | :Deletes this classification from the database. Only classifications with no associated target objects 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 classification. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods. | ||
+ | ; category | ||
+ | :Returns the 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== | ||
+ | [[Freeside:3:Documentation:Developer/FS/category Common|FS::category_Common]], [[Freeside:3:Documentation:Developer/FS/pkg class|FS::pkg_class]], [[Freeside:3:Documentation:Developer/FS/cust class|FS::cust_class]] | ||
+ | |||
+ | ==POD ERRORS== | ||
+ | Hey! '''The above document had some coding errors, which are explained below:''' | ||
+ | |||
+ | ; Around line 136: | ||
+ | :You forgot a '=back' before '=head1' |
Revision as of 06:30, 10 February 2015
NAME
FS::class_Common - Base class for classification classes
SYNOPSIS
use base qw( FS::class_Common ); use FS::category_table; #should use this
- required sub _target_table { 'table_name'; }
- optional for non-standard names sub _target_column { 'classnum'; } #default is classnum sub _category_table { 'table_name'; } #default is to replace s/class/category/
DESCRIPTION
FS::class_Common is a base class for classes which provide a classification for other classes, such as pkg_class or cust_class.
METHODS
- new HASHREF
- Creates a new classification. To add the classfication to the database, see "insert".
- insert
- Adds this classification to the database. If there is an error, returns the error, otherwise returns false.
- delete
- Deletes this classification from the database. Only classifications with no associated target objects 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 classification. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
- category
- Returns the 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::category_Common, FS::pkg_class, FS::cust_class
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 136:
- You forgot a '=back' before '=head1'