1 package FS::dsl_device;
4 use base qw( FS::Record );
5 use FS::Record qw( qsearch qsearchs );
10 FS::dsl_device - Object methods for dsl_device records
16 $record = new FS::dsl_device \%hash;
17 $record = new FS::dsl_device { 'column' => 'value' };
19 $error = $record->insert;
21 $error = $new_record->replace($old_record);
23 $error = $record->delete;
25 $error = $record->check;
29 An FS::dsl_device object represents a specific customer MAC address. The
30 following fields are currently supported:
55 Creates a new device. To add the device 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 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'dsl_device'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid device. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
100 # the check method should currently be supplied - FS::Record contains some
101 # data checking routines
107 $self->ut_numbern('devicenum')
108 || $self->ut_foreign_key('svcnum', 'svc_dsl', 'svcnum' )
109 || $self->ut_mac_addr('mac_addr')
111 return $error if $error;
118 Returns the phone number (see L<FS::svc_dsl>) associated with this customer
125 qsearchs( 'svc_dsl', { 'svcnum' => $self->svcnum } );
134 L<FS::Record>, schema.html from the base documentation.