Difference between revisions of "Freeside:1.7:Documentation:Developer/FS/rate detail"

From Freeside
Jump to: navigation, search
(import from POD)
 
m (Edit via perl MediaWiki framework (1.13))
 
(One intermediate revision by the same user not shown)
Line 20: Line 20:
 
An FS::rate_detail object represents an call plan rate. FS::rate_detail inherits from FS::Record. The following fields are currently supported:
 
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 [[Freeside:1.7:Documentation:Developer/FS/rate|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
+
; ratedetailnum - primary key; ratenum - rate plan (see [[Freeside:1.7:Documentation:Developer/FS/rate|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==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF
Line 34: Line 34:
 
; check
 
; 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.
 
: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 [[Freeside:1.7:Documentation:Developer/FS/rate|FS::rate]]) associated with this call plan rate.
 
; orig_region
 
; orig_region
 
:Returns the origination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 
:Returns the origination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 
; dest_region
 
; dest_region
 
:Returns the destination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 
:Returns the destination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 +
; dest_regionname
 +
:Returns the name of the destination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 +
; dest_regionname
 +
:Returns a short list of the prefixes for the destination region (see [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]]) associated with this call plan rate.
 +
 +
==SUBROUTINES==
 +
; granularities<code>
 +
  Returns an (ordered) hash of granularity => name pairs
 +
</code>
  
 
==BUGS==
 
==BUGS==
 
==SEE ALSO==
 
==SEE ALSO==
 
[[Freeside:1.7:Documentation:Developer/FS/rate|FS::rate]], [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]], [[Freeside:1.7:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.
 
[[Freeside:1.7:Documentation:Developer/FS/rate|FS::rate]], [[Freeside:1.7:Documentation:Developer/FS/rate region|FS::rate_region]], [[Freeside:1.7:Documentation:Developer/FS/Record|FS::Record]], schema.html from the base documentation.

Latest revision as of 13:03, 23 July 2009

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.