1 package FS::export_device;
2 use base qw( FS::Record );
8 FS::export_device - Object methods for export_device records
12 use FS::export_device;
14 $record = new FS::export_device \%hash;
15 $record = new FS::export_device { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::export_device object links a device definition (see L<FS::part_device>)
28 to an export (see L<FS::part_export>). FS::export_device inherits from
29 FS::Record. The following fields are currently supported:
33 =item exportdevicenum - primary key
35 =item exportnum - export (see L<FS::part_export>)
37 =item devicepart - device definition (see L<FS::part_device>)
47 Creates a new record. To add the record to the database, see L<"insert">.
49 Note that this stores the hash reference, not a distinct copy of the hash it
50 points to. You can ask the object for a copy with the I<hash> method.
54 sub table { 'export_device'; }
58 Adds this record to the database. If there is an error, returns the error,
59 otherwise returns false.
63 # may want to check for duplicates against either services or devices
68 Delete this record from the database.
72 =item replace OLD_RECORD
74 Replaces the OLD_RECORD with this one in the database. If there is an error,
75 returns the error, otherwise returns false.
81 Checks all fields to make sure this is a valid record. If there is
82 an error, returns the error, otherwise returns false. Called by the insert
90 $self->ut_numbern('exportdevicenum')
91 || $self->ut_number('exportnum')
92 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
93 || $self->ut_number('devicepart')
94 || $self->ut_foreign_key('devicepart', 'part_device', 'devicepart')
95 || $self->SUPER::check
101 Returns the FS::part_export object (see L<FS::part_export>).
105 Returns the FS::part_device object (see L<FS::part_device>).
113 L<FS::part_export>, L<FS::part_device>, L<FS::Record>, schema.html from the base