1 package FS::export_batch_item;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::export_batch_item - Object methods for export_batch_item records
13 use FS::export_batch_item;
15 $record = new FS::export_batch_item \%hash;
16 $record = new FS::export_batch_item { '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_batch_item object represents a service change (insert, delete,
29 replace, suspend, unsuspend, or relocate) queued for processing by a
30 batch-oriented export.
32 FS::export_batch_item inherits from FS::Record. The following fields are
43 L<FS::export_batch> foreign key; the batch that this item belongs to.
47 L<FS::cust_svc> foreign key; the service that is being exported.
51 One of 'insert', 'delete', 'replace', 'suspend', 'unsuspend', or 'relocate'.
55 A place for the export to store data relating to the service change.
59 A flag indicating that C<data> is a base64-Storable encoded object rather
68 Creates a new batch item. To add the example to the database, see L<"insert">.
70 Note that this stores the hash reference, not a distinct copy of the hash it
71 points to. You can ask the object for a copy with the I<hash> method.
75 sub table { 'export_batch_item'; }
79 Adds this record to the database. If there is an error, returns the error,
80 otherwise returns false.
84 Delete this record from the database.
86 =item replace OLD_RECORD
88 Replaces the OLD_RECORD with this one in the database. If there is an error,
89 returns the error, otherwise returns false.
93 Checks all fields to make sure this is a valid example. If there is
94 an error, returns the error, otherwise returns false. Called by the insert
103 $self->ut_numbern('itemnum')
104 || $self->ut_number('batchnum')
105 || $self->ut_foreign_key('batchnum', 'export_batch', 'batchnum')
106 || $self->ut_number('svcnum')
107 || $self->ut_enum('action',
108 [ qw(insert delete replace suspend unsuspend relocate) ]
110 || $self->ut_anything('data')
111 || $self->ut_flag('frozen')
113 return $error if $error;
124 L<FS::export_batch>, L<FS::cust_svc>