1 package FS::webservice_log;
2 use base qw( FS::Record );
8 FS::webservice_log - Object methods for webservice_log records
12 use FS::webservice_log;
14 $record = new FS::webservice_log \%hash;
15 $record = new FS::webservice_log { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::webservice_log object represents an web service log entry.
28 FS::webservice_log inherits from FS::Record. The following fields are
33 =item webservicelognum
74 Creates a new log entry. To add the log entry to the database, see L<"insert">.
76 Note that this stores the hash reference, not a distinct copy of the hash it
77 points to. You can ask the object for a copy with the I<hash> method.
81 # the new method can be inherited from FS::Record, if a table method is defined
82 sub table { 'webservice_log'; }
86 Adds this record to the database. If there is an error, returns the error,
87 otherwise returns false.
91 Delete this record from the database.
93 =item replace OLD_RECORD
95 Replaces the OLD_RECORD with this one in the database. If there is an error,
96 returns the error, otherwise returns false.
100 Checks all fields to make sure this is a valid log entry. If there is
101 an error, returns the error, otherwise returns false. Called by the insert
110 $self->ut_numbern('webservicelognum')
111 || $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum')
112 || $self->ut_foreign_key('custnum', 'cust_main', 'custnum')
113 || $self->ut_text('method')
114 || $self->ut_number('quantity')
115 || $self->ut_numbern('_date')
116 || $self->ut_alphan('status')
117 || $self->ut_moneyn('rated_price')
119 return $error if $error;
121 $self->_date(time) unless $self->_date;