1 package FS::pbx_extension;
2 use base qw( FS::Record );
5 #use FS::Record qw( qsearch qsearchs );
9 FS::pbx_extension - Object methods for pbx_extension records
13 use FS::pbx_extension;
15 $record = new FS::pbx_extension \%hash;
16 $record = new FS::pbx_extension { '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_extension object represents an PBX extension. FS::pbx_extension
29 inherits from FS::Record. The following fields are currently supported:
66 Creates a new extension. To add the extension to the database, see L<"insert">.
68 Note that this stores the hash reference, not a distinct copy of the hash it
69 points to. You can ask the object for a copy with the I<hash> method.
73 sub table { 'pbx_extension'; }
77 Adds this record to the database. If there is an error, returns the error,
78 otherwise returns false.
82 Delete this record from the database.
84 =item replace OLD_RECORD
86 Replaces the OLD_RECORD with this one in the database. If there is an error,
87 returns the error, otherwise returns false.
91 Checks all fields to make sure this is a valid extension. If there is
92 an error, returns the error, otherwise returns false. Called by the insert
101 $self->ut_numbern('extensionnum')
102 || $self->ut_foreign_key('svcnum', 'svc_pbx', 'svcnum')
103 || $self->ut_number('extension')
104 || $self->ut_numbern('pin')
105 || $self->ut_textn('sip_password')
106 || $self->ut_textn('phone_name')
108 return $error if $error;
119 L<FS::svc_pbx>, L<FS::Record>