- $self->ut_numbern('nasnum')
- || $self->ut_text('nas')
- || $self->ut_ip('nasip')
- || $self->ut_domain('nasfqdn')
- || $self->ut_numbern('last');
-}
-
-=item heartbeat TIMESTAMP
-
-Updates the timestamp for this nas
-
-=cut
-
-sub heartbeat {
- my($self, $timestamp) = @_;
- my $dbh = dbh;
- my $sth = $dbh->prepare("LOCK TABLES nas WRITE");
- $sth->execute or die $sth->errstr; #die?
- my $lock_self = qsearchs('nas', { 'nasnum' => $self->nasnum } )
- or die "can't find own record for $self nasnum ". $self->nasnum;
- if ( $timestamp > $lock_self->last ) {
- my $new_self = new FS::nas ( { $lock_self->hash } );
- $new_self->last($timestamp);
- #is there a reason to? #$self->last($timestamp);
- $new_self->replace($lock_self);
- };
- $sth = $dbh->prepare("UNLOCK TABLES");
- $sth->execute or die $sth->errstr; #die?
+ my $error =
+ $self->ut_numbern('nasnum')
+ || $self->ut_text('nasname')
+ || $self->ut_textn('shortname')
+ || $self->ut_text('type')
+ || $self->ut_numbern('ports')
+ || $self->ut_text('secret')
+ || $self->ut_textn('server')
+ || $self->ut_textn('community')
+ || $self->ut_text('description')
+ ;
+ return $error if $error;
+
+ $self->SUPER::check;