1 package FS::export_device;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs dbh );
11 FS::export_device - Object methods for export_device records
15 use FS::export_device;
17 $record = new FS::export_device \%hash;
18 $record = new FS::export_device { 'column' => 'value' };
20 $error = $record->insert;
22 $error = $new_record->replace($old_record);
24 $error = $record->delete;
26 $error = $record->check;
30 An FS::export_device object links a device definition (see L<FS::part_device>)
31 to an export (see L<FS::part_export>). FS::export_device inherits from
32 FS::Record. The following fields are currently supported:
36 =item exportdevicenum - primary key
38 =item exportnum - export (see L<FS::part_export>)
40 =item devicepart - device definition (see L<FS::part_device>)
50 Creates a new record. To add the record to the database, see L<"insert">.
52 Note that this stores the hash reference, not a distinct copy of the hash it
53 points to. You can ask the object for a copy with the I<hash> method.
57 sub table { 'export_device'; }
61 Adds this record to the database. If there is an error, returns the error,
62 otherwise returns false.
66 # may want to check for duplicates against either services or devices
71 Delete this record from the database.
75 =item replace OLD_RECORD
77 Replaces the OLD_RECORD with this one in the database. If there is an error,
78 returns the error, otherwise returns false.
84 Checks all fields to make sure this is a valid record. If there is
85 an error, returns the error, otherwise returns false. Called by the insert
93 $self->ut_numbern('exportdevicenum')
94 || $self->ut_number('exportnum')
95 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
96 || $self->ut_number('devicepart')
97 || $self->ut_foreign_key('devicepart', 'part_device', 'devicepart')
98 || $self->SUPER::check
104 Returns the FS::part_export object (see L<FS::part_export>).
110 qsearchs( 'part_export', { 'exportnum' => $self->exportnum } );
115 Returns the FS::part_device object (see L<FS::part_device>).
121 qsearchs( 'part_device', { 'svcpart' => $self->devicepart } );
130 L<FS::part_export>, L<FS::part_device>, L<FS::Record>, schema.html from the base