# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
- my $option_record = $option_table->new($href);
+ my $option_record = "FS::$option_table"->new($href);
$error = $option_record->insert;
if ( $error ) {
}
my $pkey = $self->pkey;
- my $option_table = $self->option_table;
+ #my $option_table = $self->option_table;
foreach my $obj ( $self->option_objects ) {
my $error = $obj->delete;
}
-=item replace [ HASHREF | OPTION => VALUE ... ]
+=item replace OLD_RECORD [ HASHREF | OPTION => VALUE ... ]
Replaces the OLD_RECORD with this one in the database. If there is an error,
returns the error, otherwise returns false.
# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
- my $new = $option_table->new($href);
+ my $new = "FS::$option_table"->new($href);
$new->optionnum($old->optionnum) if $old;
my $error = $old ? $new->replace($old) : $new->insert;