1 package FS::alarm_type;
4 use base qw( FS::Record );
5 use FS::Record; # qw( qsearch qsearchs );
10 FS::alarm_type - Object methods for alarm_type records
16 $record = new FS::alarm_type \%hash;
17 $record = new FS::alarm_type { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::alarm_type object represents an alarm system type (number of inputs and
30 outputs). FS::alarm_type inherits from FS::Record. The following fields are
63 Creates a new type. To add the type to the database, see L<"insert">.
65 Note that this stores the hash reference, not a distinct copy of the hash it
66 points to. You can ask the object for a copy with the I<hash> method.
70 sub table { 'alarm_type'; }
74 Adds this record to the database. If there is an error, returns the error,
75 otherwise returns false.
79 Delete this record from the database.
81 =item replace OLD_RECORD
83 Replaces the OLD_RECORD with this one in the database. If there is an error,
84 returns the error, otherwise returns false.
88 Checks all fields to make sure this is a valid type. If there is
89 an error, returns the error, otherwise returns false. Called by the insert
98 $self->ut_numbern('alarmtypenum')
99 || $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum')
100 || $self->ut_number('inputs')
101 || $self->ut_number('outputs')
102 || $self->ut_enum('disabled', ['', 'Y'])
104 return $error if $error;
117 $self->inputs. 'x'. $self->outputs;
126 L<FS::svc_alarm>, L<FS::Record>