1 package FS::export_nas;
4 use vars qw($noexport_hack);
5 use base qw( FS::Record );
6 use FS::Record qw( qsearch qsearchs );
12 FS::export_nas - Object methods for export_nas records
18 $record = new FS::export_nas \%hash;
19 $record = new FS::export_nas { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::export_nas object links RADIUS exports (in the part_export table)
32 to RADIUS clients (in the nas table). FS::export_nas inherits from
33 FS::Record. The following fields are currently supported:
58 Creates a new record. To add the record to the database, see L<"insert">.
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 # the new method can be inherited from FS::Record, if a table method is defined
67 sub table { 'export_nas'; }
71 Adds this record to the database. If there is an error, returns the error,
72 otherwise returns false.
78 $self->SUPER::insert ||
79 ($noexport_hack ? '' : $self->part_export->export_nas_insert($self->nas));
84 Delete this record from the database.
90 ($noexport_hack ? '' : $self->part_export->export_nas_delete($self->nas))
91 || $self->SUPER::delete;
94 =item replace OLD_RECORD
96 Unavailable. Delete the record and create a new one.
101 die "replace not implemented for export_nas records";
106 Checks all fields to make sure this is a valid record. If there is
107 an error, returns the error, otherwise returns false. Called by the insert
112 # the check method should currently be supplied - FS::Record contains some
113 # data checking routines
119 $self->ut_numbern('exportnasnum')
120 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum' )
121 || $self->ut_foreign_key('nasnum', 'nas', 'nasnum')
123 return $error if $error;
130 qsearchs('part_export', { 'exportnum' => $self->exportnum });
135 qsearchs('nas', { 'nasnum' => $self->nasnum });
144 L<FS::Record>, schema.html from the base documentation.