X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Frouter.pm;h=c0c93dd32dad30606409b65db4ff15723e586701;hp=937dc1f45825cd423b6e1ea693b7d3b0a8a7a8e4;hb=389b6f1116c3309c2ee57a6c295ed1a793503095;hpb=00de593a7e5b5b50aeec62c0ddb90db7bcd62f55 diff --git a/FS/FS/router.pm b/FS/FS/router.pm index 937dc1f45..c0c93dd32 100755 --- a/FS/FS/router.pm +++ b/FS/FS/router.pm @@ -1,12 +1,10 @@ package FS::router; +use base qw( FS::m2m_Common FS::Record ); use strict; -use vars qw( @ISA ); use FS::Record qw( qsearchs qsearch dbh ); use FS::addr_block; -@ISA = qw( FS::Record FS::m2m_Common ); - =head1 NAME FS::router - Object methods for router records @@ -116,7 +114,7 @@ sub replace { my $error = $self->SUPER::replace($old, @_); return $error if $error; - if ( defined($self->blocknum) ) { + if ( length($self->blocknum) ) { #warn "FS::router::replace: blocknum = ".$self->blocknum."\n"; # then release any blocks we're already holding foreach my $block ($self->addr_block) { @@ -202,6 +200,13 @@ sub delete { Returns a list of FS::addr_block objects (address blocks) associated with this object. +=cut + +sub addr_block { + my $self = shift; + qsearch('addr_block', { routernum => $self->routernum }); +} + =item auto_addr_block Returns a list of address blocks on which auto-assignment of IP addresses @@ -209,11 +214,6 @@ is enabled. =cut -sub addr_block { - my $self = shift; - return qsearch('addr_block', { routernum => $self->routernum }); -} - sub auto_addr_block { my $self = shift; return () if $self->manual_addr; @@ -227,13 +227,6 @@ 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. -=cut - -sub part_svc_router { - my $self = shift; - return qsearch('part_svc_router', { routernum => $self->routernum }); -} - =item part_svc Returns a list of FS::part_svc objects associated with this object. @@ -250,25 +243,12 @@ sub part_svc { Returns the agent associated with this router, if any. -=cut - -sub agent { - qsearchs('agent', { 'agentnum' => shift->agentnum }); -} - =item cust_svc Returns the cust_svc associated with this router, if any. This should be the service that I, not any service connected I the router. -=cut - -sub cust_svc { - my $svcnum = shift->svcnum or return undef; - FS::cust_svc->by_key($svcnum); -} - =back =head1 SEE ALSO