5 #use FS::Record qw( qsearch qsearchs );
8 @ISA = qw( FS::svc_Common );
12 FS::svc_phone - Object methods for svc_phone records
18 $record = new FS::svc_phone \%hash;
19 $record = new FS::svc_phone { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
29 $error = $record->suspend;
31 $error = $record->unsuspend;
33 $error = $record->cancel;
37 An FS::svc_phone object represents a phone number. FS::svc_phone inherits
38 from FS::Record. The following fields are currently supported:
42 =item svcnum - primary key
58 Creates a new phone number. To add the number to the database, see L<"insert">.
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 # the new method can be inherited from FS::Record, if a table method is defined
67 sub table { 'svc_phone'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
76 # the insert method can be inherited from FS::Record
80 Delete this record from the database.
84 # the delete method can be inherited from FS::Record
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 # the replace method can be inherited from FS::Record
97 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
101 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
105 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
109 Checks all fields to make sure this is a valid phone number. If there is
110 an error, returns the error, otherwise returns false. Called by the insert
115 # the check method should currently be supplied - FS::Record contains some
116 # data checking routines
122 $self->ut_numbern('svcnum')
123 || $self->ut_numbern('countrycode')
124 || $self->ut_number('phonenum')
125 || $self->ut_numbern('pin')
127 return $error if $error;
129 $self->countrycode(1) unless $self->countrycode;
140 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
141 L<FS::cust_pkg>, schema.html from the base documentation.