X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fnas.pm;h=cb0c1b9013c7b5fb464bc9ba9e362ed198644368;hp=873c9bce6b006b63379a13c0c62b670a5779fd2b;hb=44e51a5c50be350fa698bcdcf86ad5c01a7631a2;hpb=7f07089722bfcabe3bf42619bb2bdb81fd8d44e1 diff --git a/FS/FS/nas.pm b/FS/FS/nas.pm index 873c9bce6..cb0c1b901 100644 --- a/FS/FS/nas.pm +++ b/FS/FS/nas.pm @@ -2,8 +2,8 @@ package FS::nas; use strict; use vars qw( @ISA ); -use FS::Record qw(); -#use FS::Record qw( qsearch qsearchs ); +use FS::Record qw(qsearchs); #qsearch); +use FS::UID qw( dbh ); @ISA = qw(FS::Record); @@ -117,26 +117,29 @@ sub check { || $self->ut_numbern('last'); } -=sub heartbeat TIMESTAMP +=item heartbeat TIMESTAMP Updates the timestamp for this nas =cut sub heartbeat { - warn "warning: heartbeat unimplemented!" + my($self, $timestamp) = @_; + my $dbh = dbh; + my $sth = + $dbh->prepare("UPDATE nas SET last = ? WHERE nasnum = ? AND last < ?"); + $sth->execute($timestamp, $self->nasnum, $timestamp) or die $sth->errstr; + $self->last($timestamp); } =back =head1 VERSION -$Id: nas.pm,v 1.2 2000-11-07 15:00:37 ivan Exp $ +$Id: nas.pm,v 1.5 2001-04-15 13:35:12 ivan Exp $ =head1 BUGS -The author forgot to customize this manpage. - =head1 SEE ALSO L, schema.html from the base documentation.