1 package FS::extension_device;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::extension_device - Object methods for extension_device records
13 use FS::extension_device;
15 $record = new FS::extension_device \%hash;
16 $record = new FS::extension_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::extension_device object represents a PBX extension association with a
29 specific PBX device (SIP phone or ATA). FS::extension_device inherits from
30 FS::Record. The following fields are currently supported:
34 =item extensiondevicenum
55 Creates a new record. To add the record to the database, see L<"insert">.
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 sub table { 'extension_device'; }
66 Adds this record to the database. If there is an error, returns the error,
67 otherwise returns false.
71 Delete this record from the database.
73 =item replace OLD_RECORD
75 Replaces the OLD_RECORD with this one in the database. If there is an error,
76 returns the error, otherwise returns false.
80 Checks all fields to make sure this is a valid record. If there is
81 an error, returns the error, otherwise returns false. Called by the insert
90 $self->ut_numbern('extensiondevicenum')
91 || $self->ut_foreign_keyn('extensionnum', 'pbx_extension', 'extensionnum')
92 || $self->ut_foreign_keyn('devicenum', 'pbx_device', 'devicenum')
94 return $error if $error;