1 package FS::svc_external;
4 use vars qw(@ISA); # $conf
6 #use FS::Record qw( qsearch qsearchs dbh);
9 @ISA = qw( FS::svc_Common );
11 #FS::UID::install_callback( sub {
12 # $conf = new FS::Conf;
17 FS::svc_external - Object methods for svc_external records
23 $record = new FS::svc_external \%hash;
24 $record = new FS::svc_external { 'column' => 'value' };
26 $error = $record->insert;
28 $error = $new_record->replace($old_record);
30 $error = $record->delete;
32 $error = $record->check;
34 $error = $record->suspend;
36 $error = $record->unsuspend;
38 $error = $record->cancel;
42 An FS::svc_external object represents a externally tracked service.
43 FS::svc_external inherits from FS::svc_Common. The following fields are
48 =item svcnum - primary key
50 =item id - unique number of external record
52 =item title - for invoice line items
62 Creates a new external service. To add the external service to the database,
65 Note that this stores the hash reference, not a distinct copy of the hash it
66 points to. You can ask the object for a copy with the I<hash> method.
70 sub table { 'svc_external'; }
74 Adds this external service to the database. If there is an error, returns the
75 error, otherwise returns false.
77 The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
78 defined. An FS::cust_svc record will be created and inserted.
86 $error = $self->SUPER::insert;
87 return $error if $error;
94 Delete this record from the database.
102 $error = $self->SUPER::delete;
103 return $error if $error;
109 =item replace OLD_RECORD
111 Replaces the OLD_RECORD with this one in the database. If there is an error,
112 returns the error, otherwise returns false.
117 my ( $new, $old ) = ( shift, shift );
120 $error = $new->SUPER::replace($old);
121 return $error if $error;
128 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
132 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
136 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
140 Checks all fields to make sure this is a valid external service. If there is
141 an error, returns the error, otherwise returns false. Called by the insert
149 my $x = $self->setfixed;
150 return $x unless ref($x);
154 $self->ut_numbern('svcnum')
155 || $self->ut_number('id')
156 || $self->ut_textn('title')
168 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
169 L<FS::cust_pkg>, schema.html from the base documentation.