1 package FS::export_cust_svc;
2 use base qw(FS::Record);
5 use FS::Record qw( qsearchs );
9 FS::export_cust_svc - Object methods for export_cust_svc records
13 use FS::export_cust_svc;
15 $record = new FS::export_cust_svc \%hash;
16 $record = new FS::export_cust_svc { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::export_cust_svc object represents information unique
29 to a given part_export and cust_svc pair.
30 FS::export_cust_svc inherits from FS::Record.
31 The following fields are currently supported:
35 =item exportcustsvcnum - primary key
37 =item exportnum - export (see L<FS::part_export>)
39 =item svcnum - service (see L<FS::cust_svc>)
41 =item remoteid - id for accessing service on export remote system
51 Creates a new export_cust_svc object. To add the object to the database, see
54 Note that this stores the hash reference, not a distinct copy of the hash it
55 points to. You can ask the object for a copy with the I<hash> method.
59 # the new method can be inherited from FS::Record, if a table method is defined
61 sub table { 'export_cust_svc'; }
65 Adds this record to the database. If there is an error, returns the error,
66 otherwise returns false.
72 return "export_cust_svc for exportnum ".$self->exportnum.
73 " svcnum ".$self->svcnum." already exists"
74 if qsearchs('export_cust_svc',{ 'exportnum' => $self->exportnum,
75 'svcnum' => $self->svcnum });
81 Delete this record from the database.
85 # the delete method can be inherited from FS::Record
87 =item replace OLD_RECORD
89 Replaces the OLD_RECORD with this one in the database. If there is an error,
90 returns the error, otherwise returns false.
94 # the replace method can be inherited from FS::Record
98 Checks all fields to make sure this is a valid export option. If there is
99 an error, returns the error, otherwise returns false. Called by the insert
104 # the check method should currently be supplied - FS::Record contains some
105 # data checking routines
111 $self->ut_numbern('exportcustsvcnum')
112 || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
113 || $self->ut_foreign_key('svcnum', 'cust_svc', 'svcnum')
114 || $self->ut_text('remoteid')
116 return $error if $error;
129 L<FS::part_export>, L<FS::cust_svc>, L<FS::Record>