1 package FS::pbx_device;
2 use base qw( FS::MAC_Mixin FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::pbx_device - Object methods for pbx_device records
15 $record = new FS::pbx_device \%hash;
16 $record = new FS::pbx_device { 'column' => 'value' };
18 $error = $record->insert;
20 $error = $new_record->replace($old_record);
22 $error = $record->delete;
24 $error = $record->check;
28 An FS::pbx_device object represents a specific customer phone device, such
29 as a SIP phone or ATA. FS::pbx_device inherits from FS::Record. The following fields are currently supported:
58 Creates a new record. To add the record to the database, see L<"insert">.
60 Note that this stores the hash reference, not a distinct copy of the hash it
61 points to. You can ask the object for a copy with the I<hash> method.
65 sub table { 'pbx_device'; }
69 Adds this record to the database. If there is an error, returns the error,
70 otherwise returns false.
74 Delete this record from the database.
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 Checks all fields to make sure this is a valid record. If there is
84 an error, returns the error, otherwise returns false. Called by the insert
93 $self->ut_numbern('devicenum')
94 || $self->ut_foreign_key('devicepart', 'part_device', 'devicepart')
95 || $self->ut_foreign_key('svcnum', 'svc_pbx', 'svcnum')
96 || $self->ut_mac_addr('mac_addr')
98 return $error if $error;