1 package FS::hardware_status;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
9 FS::hardware_status - Object methods for hardware_status records
13 use FS::hardware_status;
15 $record = new FS::hardware_status \%hash;
16 $record = new FS::hardware_status { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::hardware_status object represents an installation status for hardware
29 services. FS::hardware_status inherits from FS::Record. The following fields
30 are currently supported:
34 =item statusnum - primary key
36 =item label - descriptive label
38 =item disabled - 'Y' to disable
48 Creates a new record. To add the record to the database, see L<"insert">.
50 Note that this stores the hash reference, not a distinct copy of the hash it
51 points to. You can ask the object for a copy with the I<hash> method.
55 # the new method can be inherited from FS::Record, if a table method is defined
57 sub table { 'hardware_status'; }
61 Adds this record to the database. If there is an error, returns the error,
62 otherwise returns false.
66 # the insert method can be inherited from FS::Record
70 Delete this record from the database.
74 # the delete method can be inherited from FS::Record
76 =item replace OLD_RECORD
78 Replaces the OLD_RECORD with this one in the database. If there is an error,
79 returns the error, otherwise returns false.
83 # the replace method can be inherited from FS::Record
87 Checks all fields to make sure this is a valid status. If there is
88 an error, returns the error, otherwise returns false. Called by the insert
93 # the check method should currently be supplied - FS::Record contains some
94 # data checking routines
100 $self->ut_numbern('statusnum')
101 || $self->ut_text('label')
102 || $self->ut_enum('disabled', [ '', 'Y' ])
104 return $error if $error;
113 L<FS::svc_hardware>, L<FS::Record>, schema.html from the base documentation.