Freeside:3:Documentation:Developer/FS/router

From Freeside
< Freeside:3:Documentation:Developer‎ | FS
Revision as of 21:06, 27 June 2012 by Ivan (talk | contribs) (Edit via perl MediaWiki framework (1.13))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NAME

FS::router - Object methods for router records

SYNOPSIS

 use FS::router;

 $record = new FS::router \%hash;
 $record = new FS::router { 'column' => 'value' };

 $error = $record->insert;

 $error = $new_record->replace($old_record);

 $error = $record->delete;

 $error = $record->check;

DESCRIPTION

An FS::router record describes a broadband router, such as a DSLAM or a wireless access point. FS::router inherits from FS::Record. The following fields are currently supported:

routernum - primary key; routername - descriptive name for the router; svcnum - svcnum of the owning FS::svc_broadband, if appropriate; manual_addr - set to 'Y' to allow services linked to this router to have any IP address, rather than one in an address block belonging to the router.

METHODS

new HASHREF
Create a new record. To add the record to the database, see "insert".
insert
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
delete
Deletes this record from the database. If there is an error, returns the error, otherwise returns false.
replace OLD_RECORD
Replaces OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
check
Checks all fields to make sure this is a valid record. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
delete
Deletes this router if and only if no address blocks (see FS::addr_block) are currently allocated to it.
addr_block
Returns a list of FS::addr_block objects (address blocks) associated with this object.
auto_addr_block
Returns a list of address blocks on which auto-assignment of IP addresses is enabled.
part_svc_router
Returns a list of FS::part_svc_router objects associated with this object. This is unlikely to be useful for any purpose other than retrieving the associated FS::part_svc objects. See below.
part_svc
Returns a list of FS::part_svc objects associated with this object.
agent
Returns the agent associated with this router, if any.

SEE ALSO

FS::svc_broadband, FS::router, FS::addr_block, FS::part_svc, schema.html from the base documentation.