5 use FS::Record qw( qsearchs qsearch );
8 @ISA = qw( FS::Record FS::m2m_Common );
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 || $self->ut_agentnum_acl('agentnum', 'Broadband global configuration')
88 return $error if $error;
95 Returns a list of FS::addr_block objects (address blocks) associated
102 return qsearch('addr_block', { routernum => $self->routernum });
105 =item part_svc_router
107 Returns a list of FS::part_svc_router objects associated with this
108 object. This is unlikely to be useful for any purpose other than retrieving
109 the associated FS::part_svc objects. See below.
113 sub part_svc_router {
115 return qsearch('part_svc_router', { routernum => $self->routernum });
120 Returns a list of FS::part_svc objects associated with this object.
126 return map { qsearchs('part_svc', { svcpart => $_->svcpart }) }
127 $self->part_svc_router;
132 Returns the agent associated with this router, if any.
137 qsearchs('agent', { 'agentnum' => shift->agentnum });
146 FS::svc_broadband, FS::router, FS::addr_block, FS::part_svc,
147 schema.html from the base documentation.