Difference between revisions of "Freeside:3:Documentation:Developer/FS/class Common"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
m (Edit via perl MediaWiki framework (1.13))
 
Line 22: Line 22:
 
:Replaces OLD_RECORD with this one in the database. 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.
 
; check
 
; check
:Checks all fields to make sure this is a valid classification. 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 classification. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
 
; category
 
; category
 
:Returns the category record associated with this class, or false if there is none.
 
:Returns the category record associated with this class, or false if there is none.

Latest revision as of 10:57, 10 April 2015

NAME

FS::class_Common - Base class for classification classes

SYNOPSIS

use base qw( FS::class_Common ); use FS::category_table; #should use this

  1. required sub _target_table { 'table_name'; }
  1. 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'