Freeside:1.7:Documentation:Developer/FS/rate detail

From Freeside
< Freeside:1.7:Documentation:Developer‎ | FS
Revision as of 13:03, 23 July 2009 by Ivan (talk | contribs) (Edit via perl MediaWiki framework (1.13))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::rate_detail - Object methods for rate_detail records

SYNOPSIS

 use FS::rate_detail;

 $record = new FS::rate_detail \%hash;
 $record = new FS::rate_detail { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::rate_detail object represents an call plan rate. FS::rate_detail inherits from FS::Record. The following fields are currently supported:

ratedetailnum - primary key; ratenum - rate plan (see FS::rate); orig_regionnum - call origination region; dest_regionnum - call destination region; min_included - included minutes; min_charge - charge per minute; sec_granularity - granularity in seconds, i.e. 6 or 60; 0 for per-call

METHODS

new HASHREF
Creates a new call plan rate. To add the call plan rate to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Delete this record from the database.
replace OLD_RECORD
Replaces the 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 call plan rate. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
rate
Returns the parent call plan (see FS::rate) associated with this call plan rate.
orig_region
Returns the origination region (see FS::rate_region) associated with this call plan rate.
dest_region
Returns the destination region (see FS::rate_region) associated with this call plan rate.
dest_regionname
Returns the name of the destination region (see FS::rate_region) associated with this call plan rate.
dest_regionname
Returns a short list of the prefixes for the destination region (see FS::rate_region) associated with this call plan rate.

SUBROUTINES

granularities
 Returns an (ordered) hash of granularity => name pairs

BUGS

SEE ALSO

FS::rate, FS::rate_region, FS::Record, schema.html from the base documentation.