1 package FS::part_export;
5 use FS::Record qw( qsearch qsearchs );
12 FS::part_export - Object methods for part_export records
18 $record = new FS::part_export \%hash;
19 $record = new FS::part_export { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::part_export object represents an export of Freeside data to an external
32 provisioning system. FS::part_export inherits from FS::Record. The following
33 fields are currently supported:
37 =item eventpart - primary key
39 =item svcpart - Service definition (see L<FS::part_svc>) to which this export applies
41 =item machine - Machine name
43 =item exporttype - Export type
45 =item nodomain - blank or "Y" : usernames are exported to this service with no domain
55 Creates a new export. To add the export to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'part_export'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid export. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
103 $self->ut_numbern('exportnum')
104 || $self->ut_number('svcpart')
105 || $self->ut_alpha('exporttype')
107 return $error if $error;
109 return "Unknown svcpart: ". $self->svcpart
110 unless qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
112 $self->machine =~ /^([\w\-\.]*)$/
113 or return "Illegal machine: ". $self->machine;
116 $self->nodomain =~ /^(Y?)$/ or return "Illegal nodomain: ". $self->nodomain;
132 L<FS::part_export_option>, L<FS::part_svc>, L<FS::svc_acct>, L<FS::svc_domain>,
133 L<FS::svc_forward>, L<FS::Record>, schema.html from the base documentation.