4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::did_order - Object methods for did_order records
15 $record = new FS::did_order \%hash;
16 $record = new FS::did_order { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::did_order object represents a bulk DID order. FS::did_order inherits from
29 FS::Record. The following fields are currently supported:
86 Creates a new bulk DID order. To add it to the database, see L<"insert">.
88 Note that this stores the hash reference, not a distinct copy of the hash it
89 points to. You can ask the object for a copy with the I<hash> method.
93 # the new method can be inherited from FS::Record, if a table method is defined
95 sub table { 'did_order'; }
99 Adds this record to the database. If there is an error, returns the error,
100 otherwise returns false.
104 # the insert method can be inherited from FS::Record
108 Delete this record from the database.
112 # the delete method can be inherited from FS::Record
114 =item replace OLD_RECORD
116 Replaces the OLD_RECORD with this one in the database. If there is an error,
117 returns the error, otherwise returns false.
121 # the replace method can be inherited from FS::Record
125 Checks all fields to make sure this is a valid bulk DID order. If there is
126 an error, returns the error, otherwise returns false. Called by the insert
131 # the check method should currently be supplied - FS::Record contains some
132 # data checking routines
138 $self->ut_numbern('ordernum')
139 || $self->ut_foreign_key('vendornum', 'did_vendor', 'vendornum' )
140 || $self->ut_text('vendor_order_id')
141 || $self->ut_textn('msa')
142 || $self->ut_foreign_keyn('latanum', 'lata', 'latanum')
143 || $self->ut_textn('rate_center')
144 || $self->ut_textn('state')
145 || $self->ut_number('quantity')
146 || $self->ut_number('submitted')
147 || $self->ut_numbern('confirmed')
148 || $self->ut_numbern('received')
150 return $error if $error;
161 L<FS::Record>, schema.html from the base documentation.