% 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::option_Common - Base class for option sub-classes
use FS::option_Common;
@ISA = qw( FS::option_Common );
#optional for non-standard names sub _option_table { 'table_name'; } #defaults to ${table}_option sub _option_namecol { 'column_name'; } #defaults to optionname sub _option_valuecol { 'column_name'; } #defaults to optionvalue
FS::option_Common is intended as a base class for classes which have a simple one-to-many class associated with them, used to store a hash-like data structure of keys and values.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
If a list or hash reference of options is supplied, option records are also created.
Delete this record from the database. Any associated option records are also deleted.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
If a list or hash reference of options is supplied, option records are created or modified.
This method is called by 'insert' and 'replace' to check the options that were supplied.
Return error-message, or false.
(In this class, this is a do-nothing routine that always returns false. Override as necessary. No need to call superclass.)
Returns all options as FS::tablename_option objects.
Returns a list of option names and values suitable for assigning to a hash.
Returns the option value for the given name, or the empty string.
Same as the option method, but may cache and return a cached value. Good for use within loops; otherwise, probably avoid.