4 use base qw( FS::svc_Common );
5 use FS::Record; # qw( qsearch qsearchs );
9 FS::svc_alarm - Object methods for svc_alarm records
15 $record = new FS::svc_alarm \%hash;
16 $record = new FS::svc_alarm { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::svc_alarm object represents an alarm service. FS::svc_alarm inherits
31 The following fields are currently supported:
35 =item svcnum - Primary key
37 =item alarm_system - Alarm System
39 =item alarm_type = Alarm Type
41 =item acctnum - Account number
43 =item _password - Password
45 =item location - Location on property
55 Creates a new svc_dish object.
59 sub table { 'svc_alarm'; }
62 my %opts = ( 'type' => 'text',
63 #'disable_select' => 1,
64 'disable_inventory' => 1,
67 'name' => 'Alarm service',
69 'display_weight' => 80,
70 'cancel_weight' => 85,
72 'svcnum' => { label => 'Service' },
73 'alarm_system' => { label => 'Alarm System', %opts },
74 'alarm_type' => { label => 'Alarm Type', %opts },
75 'acctnum' => { label => 'Account #', %opts },
76 '_password' => { label => 'Password', %opts },
77 'location' => { label => 'Location', %opts },
88 my($class, $string) = @_;
89 $class->search_sql_field('acctnum', $string);
94 Adds this record to the database. If there is an error, returns the error,
95 otherwise returns false.
99 Delete this record from the database.
101 =item replace OLD_RECORD
103 Replaces the OLD_RECORD with this one in the database. If there is an error,
104 returns the error, otherwise returns false.
106 # the replace method can be inherited from FS::Record
110 Checks all fields to make sure this is a valid service. If there is
111 an error, returns the error, otherwise returns false. Called by the insert
119 my $x = $self->setfixed;
120 return $x unless ref $x;
123 $self->ut_numbern('svcnum')
124 || $self->ut_text('acctnum')
125 || $self->ut_numbern('installdate')
126 || $self->ut_anything('note')
128 return $error if $error;
137 L<FS::Record>, L<FS::svc_Common>, schema.html from the base documentation.