$self->SUPER::check;
}
-=item insert [ JOBNUM_ARRAYREF ]
+=item insert [ JOBNUM_ARRAYREF [ OBJECTS_ARRAYREF ] ]
Adds this record to the database. If there is an error, returns the error,
otherwise returns false.
If an arrayref is passed as parameter, the B<jobnum>s of any export jobs will
be added to the array.
+If an arrayref of FS::tablename objects (for example, FS::acct_snarf objects)
+is passed as the optional second parameter, they will have their svcnum fields
+set and will be inserted after this record, but before any exports are run.
+
=cut
sub insert {
my $self = shift;
local $FS::queue::jobnums = shift if @_;
+ my $objects = scalar(@_) ? shift : [];
my $error;
local $SIG{HUP} = 'IGNORE';
return $error;
}
+ foreach my $object ( @$objects ) {
+ $object->svcnum($self->svcnum);
+ $error = $object->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
#new-style exports!
unless ( $noexport_hack ) {
foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
=head1 VERSION
-$Id: svc_Common.pm,v 1.13 2003-08-05 00:20:47 khoff Exp $
+$Id: svc_Common.pm,v 1.14 2003-10-25 02:05:44 ivan Exp $
=head1 BUGS