5 use FS::Record qw( qsearchs qsearch );
8 @ISA = qw( FS::Record );
12 FS::router - Object methods for router records
18 $record = new FS::router \%hash;
19 $record = new FS::router { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::router record describes a broadband router, such as a DSLAM or a wireless
32 access point. FS::router inherits from FS::Record. The following
33 fields are currently supported:
37 =item routernum - primary key
39 =item routername - descriptive name for the router
41 =item svcnum - svcnum of the owning FS::svc_broadband, if appropriate
51 Create a new record. To add the record to the database, see "insert".
55 sub table { 'router'; }
59 Adds this record to the database. If there is an error, returns the error,
60 otherwise returns false.
64 Deletes this record from the database. If there is an error, returns the
65 error, otherwise returns false.
67 =item replace OLD_RECORD
69 Replaces OLD_RECORD with this one in the database. If there is an error,
70 returns the error, otherwise returns false.
74 Checks all fields to make sure this is a valid record. If there is an error,
75 returns the error, otherwise returns false. Called by the insert and replace
84 $self->ut_numbern('routernum')
85 || $self->ut_text('routername');
86 return $error if $error;
93 Returns a list of FS::addr_block objects (address blocks) associated
100 return qsearch('addr_block', { routernum => $self->routernum });
103 =item part_svc_router
105 Returns a list of FS::part_svc_router objects associated with this
106 object. This is unlikely to be useful for any purpose other than retrieving
107 the associated FS::part_svc objects. See below.
111 sub part_svc_router {
113 return qsearch('part_svc_router', { routernum => $self->routernum });
118 Returns a list of FS::part_svc objects associated with this object.
124 return map { qsearchs('part_svc', { svcpart => $_->svcpart }) }
125 $self->part_svc_router;
134 FS::svc_broadband, FS::router, FS::addr_block, FS::part_svc,
135 schema.html from the base documentation.