1 package FS::part_export_machine;
2 use base qw( FS::Record );
5 use FS::Record qw( dbh ); #qsearch qsearchs );
9 FS::part_export_machine - Object methods for part_export_machine records
13 use FS::part_export_machine;
15 $record = new FS::part_export_machine \%hash;
16 $record = new FS::part_export_machine { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::part_export_machine object represents an export hostname choice.
29 FS::part_export_machine inherits from FS::Record. The following fields are
40 Export, see L<FS::part_export>
44 Hostname or IP address
54 Creates a new record. To add the record to the database, see L<"insert">.
56 Note that this stores the hash reference, not a distinct copy of the hash it
57 points to. You can ask the object for a copy with the I<hash> method.
61 sub table { 'part_export_machine'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
70 Delete this record from the database.
77 local $SIG{HUP} = 'IGNORE';
78 local $SIG{INT} = 'IGNORE';
79 local $SIG{QUIT} = 'IGNORE';
80 local $SIG{TERM} = 'IGNORE';
81 local $SIG{TSTP} = 'IGNORE';
82 local $SIG{PIPE} = 'IGNORE';
83 my $oldAutoCommit = $FS::UID::AutoCommit;
84 local $FS::UID::AutoCommit = 0;
87 my $error = $self->SUPER::delete;
89 $dbh->rollback if $oldAutoCommit;
93 foreach my $svc_export_machine ( $self->svc_export_machine ) {
94 my $error = $svc_export_machine->delete;
96 $dbh->rollback if $oldAutoCommit;
101 $dbh->commit or die $dbh->errstr if $oldAutoCommit;
106 =item replace OLD_RECORD
108 Replaces the OLD_RECORD with this one in the database. If there is an error,
109 returns the error, otherwise returns false.
113 Checks all fields to make sure this is a valid record. If there is
114 an error, returns the error, otherwise returns false. Called by the insert
123 $self->ut_numbern('machinenum')
124 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
125 || $self->ut_domain('machine')
126 || $self->ut_enum('disabled', [ '', 'Y' ])
128 return $error if $error;
133 =item svc_export_machine
141 L<FS::part_export>, L<FS::Record>