Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/option Common"
From Freeside
(import from POD) |
m (Edit via perl MediaWiki framework (1.13)) |
||
Line 22: | Line 22: | ||
:Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. | :Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. | ||
− | :If a list hash reference of options is supplied, option records are created or modified. | + | :If a list or hash reference of options is supplied, option records are created or modified. |
; option_objects | ; option_objects | ||
:Returns all options as FS::''tablename''_option objects. | :Returns all options as FS::''tablename''_option objects. |
Latest revision as of 17:15, 6 February 2009
Contents
NAME
FS::option_Common - Base class for option sub-classes
SYNOPSIS
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
DESCRIPTION
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.
METHODS
- insert [ HASHREF | OPTION => VALUE ... ]
- 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
- Delete this record from the database. Any associated option records are also deleted.
- replace [ OLD_RECORD ] [ HASHREF | OPTION => VALUE ... ]
- 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.
- option_objects
- Returns all options as FS::tablename_option objects.
- options
- Returns a list of option names and values suitable for assigning to a hash.
- option OPTIONNAME
- Returns the option value for the given name, or the empty string.