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'; }
72 =item insert [ , OPTION => VALUE ... ]
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.
80 Currently available options are: I<depend_jobnum>
82 If I<depend_jobnum> is set (to a scalar jobnum or an array reference of
83 jobnums), all provisioning jobs will have a dependancy on the supplied
84 jobnum(s) (they will not run until the specific job(s) complete(s)).
92 # $error = $self->SUPER::insert(@_);
93 # return $error if $error;
100 Delete this record from the database.
108 # $error = $self->SUPER::delete;
109 # return $error if $error;
115 =item replace OLD_RECORD
117 Replaces the OLD_RECORD with this one in the database. If there is an error,
118 returns the error, otherwise returns false.
123 # my ( $new, $old ) = ( shift, shift );
126 # $error = $new->SUPER::replace($old);
127 # return $error if $error;
134 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
138 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
142 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
146 Checks all fields to make sure this is a valid external service. If there is
147 an error, returns the error, otherwise returns false. Called by the insert
155 my $x = $self->setfixed;
156 return $x unless ref($x);
160 $self->ut_numbern('svcnum')
161 || $self->ut_numbern('id')
162 || $self->ut_textn('title')
174 L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
175 L<FS::cust_pkg>, schema.html from the base documentation.