X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fexport_nas.pm;h=5282503d0e95f20c862fb703e578090fc43f9e91;hb=573139dbd6c37808697bfa72a3a468bb0980d4dd;hp=3829b41c70a91f434e9703c42ac8e68211aed11c;hpb=f084388d2e552f3e2a44d1705cb2930b2c9e4989;p=freeside.git diff --git a/FS/FS/export_nas.pm b/FS/FS/export_nas.pm index 3829b41c7..5282503d0 100644 --- a/FS/FS/export_nas.pm +++ b/FS/FS/export_nas.pm @@ -1,9 +1,12 @@ package FS::export_nas; use strict; +use vars qw($noexport_hack); use base qw( FS::Record ); use FS::Record qw( qsearch qsearchs ); +$noexport_hack = ''; + =head1 NAME FS::export_nas - Object methods for export_nas records @@ -70,7 +73,11 @@ otherwise returns false. =cut -# the insert method can be inherited from FS::Record +sub insert { + my $self = shift; + $self->SUPER::insert || + ($noexport_hack ? '' : $self->part_export->export_nas_insert($self->nas)); +} =item delete @@ -78,16 +85,21 @@ Delete this record from the database. =cut -# the delete method can be inherited from FS::Record +sub delete { + my $self = shift; + ($noexport_hack ? '' : $self->part_export->export_nas_delete($self->nas)) + || $self->SUPER::delete; +} =item replace OLD_RECORD -Replaces the OLD_RECORD with this one in the database. If there is an error, -returns the error, otherwise returns false. +Unavailable. Delete the record and create a new one. =cut -# the replace method can be inherited from FS::Record +sub replace { + die "replace not implemented for export_nas records"; +} =item check @@ -113,6 +125,16 @@ sub check { $self->SUPER::check; } +sub part_export { + my $self = shift; + qsearchs('part_export', { 'exportnum' => $self->exportnum }); +} + +sub nas { + my $self = shift; + qsearchs('nas', { 'nasnum' => $self->nasnum }); +} + =back =head1 BUGS