Difference between revisions of "Freeside:1.9:Documentation:Developer/FS/svc phone"

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 26: Line 26:
 
An FS::svc_phone object represents a phone number. FS::svc_phone inherits from FS::Record. The following fields are currently supported:
 
An FS::svc_phone object represents a phone number. FS::svc_phone inherits from FS::Record. The following fields are currently supported:
  
; svcnum - primary key; countrycode -; phonenum -; pin -
+
; svcnum
 +
:primary key
 +
; countrycode; phonenum; sip_password; pin
 +
:Voicemail PIN
 +
; phone_name
 
==METHODS==
 
==METHODS==
 
; new HASHREF
 
; new HASHREF
:Creates a new phone number. To add the number to the database, see [[Freeside:1.9:Documentation:Developer/#insert|"insert"|#insert|"insert"]].
+
:Creates a new phone number. To add the number to the database, see [[#insert|"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.
 
: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.
Line 50: Line 54:
 
; check
 
; check
 
:Checks all fields to make sure this is a valid phone number. 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 phone number. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
 
+
; _check duplicate
 +
:Internal method to check for duplicate phone numers.
 +
; check_pin
 +
:Checks the supplied PIN against the PIN in the database. Returns true for a sucessful authentication, false if no match.
 +
; radius_reply; radius_check
 
==BUGS==
 
==BUGS==
 
==SEE ALSO==
 
==SEE ALSO==
 
[[Freeside:1.9:Documentation:Developer/FS/svc Common|FS::svc_Common]], [[Freeside:1.9:Documentation:Developer/FS/Record|FS::Record]], [[Freeside:1.9:Documentation:Developer/FS/cust svc|FS::cust_svc]], [[Freeside:1.9:Documentation:Developer/FS/part svc|FS::part_svc]], [[Freeside:1.9:Documentation:Developer/FS/cust pkg|FS::cust_pkg]], schema.html from the base documentation.
 
[[Freeside:1.9:Documentation:Developer/FS/svc Common|FS::svc_Common]], [[Freeside:1.9:Documentation:Developer/FS/Record|FS::Record]], [[Freeside:1.9:Documentation:Developer/FS/cust svc|FS::cust_svc]], [[Freeside:1.9:Documentation:Developer/FS/part svc|FS::part_svc]], [[Freeside:1.9:Documentation:Developer/FS/cust pkg|FS::cust_pkg]], schema.html from the base documentation.

Latest revision as of 17:16, 6 February 2009

NAME

FS::svc_phone - Object methods for svc_phone records

SYNOPSIS

 use FS::svc_phone;

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

 $error = $record->insert;

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

 $error = $record->delete;

 $error = $record->check;

 $error = $record->suspend;

 $error = $record->unsuspend;

 $error = $record->cancel;

DESCRIPTION

An FS::svc_phone object represents a phone number. FS::svc_phone inherits from FS::Record. The following fields are currently supported:

svcnum
primary key
countrycode; phonenum; sip_password; pin
Voicemail PIN
phone_name

METHODS

new HASHREF
Creates a new phone number. To add the number 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.
search_sql STRING
Class method which returns an SQL fragment to search for the given string.
label
Returns the phone number.
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.
suspend
Called by the suspend method of FS::cust_pkg (see FS::cust_pkg).
unsuspend
Called by the unsuspend method of FS::cust_pkg (see FS::cust_pkg).
cancel
Called by the cancel method of FS::cust_pkg (see FS::cust_pkg).
check
Checks all fields to make sure this is a valid phone number. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
_check duplicate
Internal method to check for duplicate phone numers.
check_pin
Checks the supplied PIN against the PIN in the database. Returns true for a sucessful authentication, false if no match.
radius_reply; radius_check

BUGS

SEE ALSO

FS::svc_Common, FS::Record, FS::cust_svc, FS::part_svc, FS::cust_pkg, schema.html from the base documentation.