clean up some harmless but scary "Multiple records in scalar search" warnings w/histo...
authorivan <ivan>
Thu, 3 Mar 2005 10:25:22 +0000 (10:25 +0000)
committerivan <ivan>
Thu, 3 Mar 2005 10:25:22 +0000 (10:25 +0000)
FS/FS/h_Common.pm
FS/FS/h_cust_svc.pm
FS/FS/h_domain_record.pm [new file with mode: 0644]
FS/FS/h_svc_acct.pm
FS/FS/h_svc_forward.pm
FS/FS/h_svc_www.pm
FS/MANIFEST
FS/t/h_domain_record.t [new file with mode: 0644]

index 58ead88..a7bb937 100644 (file)
@@ -69,6 +69,20 @@ sub sql_h_search {
 
 }
 
+=item sql_h_searchs END_TIMESTAMP [ START_TIMESTAMP ] 
+
+Like sql_h_search, but limited to the single most recent record (before
+END_TIMESTAMP)
+
+=cut
+
+sub sql_h_searchs {
+  my $self = shift;
+  my($select, $where, $cacheobj, $as) = $self->sql_h_search(@_);
+  $where .= ' LIMIT 1';
+  ($select, $where, $cacheobj, $as);
+}
+
 =back
 
 =head1 BUGS
index 9ef60fd..17be97d 100644 (file)
@@ -64,7 +64,7 @@ sub h_svc_x {
     require "FS/h_$svcdb.pm";
     qsearchs( "h_$svcdb",
               { 'svcnum'       => $self->svcnum, },
-              "FS::h_$svcdb"->sql_h_search(@_),
+              "FS::h_$svcdb"->sql_h_searchs(@_),
             );
   #}
 }
diff --git a/FS/FS/h_domain_record.pm b/FS/FS/h_domain_record.pm
new file mode 100644 (file)
index 0000000..0ab974f
--- /dev/null
@@ -0,0 +1,33 @@
+package FS::h_domain_record;
+
+use strict;
+use vars qw( @ISA );
+use FS::h_Common;
+use FS::domain_record;
+
+@ISA = qw( FS::h_Common FS::domain_record );
+
+sub table { 'h_domain_record' };
+
+=head1 NAME
+
+FS::h_domain_record - Historical DNS entry objects
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+An FS::h_domain_record object represents a historical entry in a DNS zone.
+FS::h_domain_record inherits from FS::h_Common and FS::domain_record.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::h_Common>, L<FS::svc_external>, L<FS::Record>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
index cd98dd4..95c5c41 100644 (file)
@@ -29,7 +29,7 @@ sub svc_domain {
   my $self = shift;
   qsearchs( 'h_svc_domain',
             { 'svcnum' => $self->domsvc },
-            FS::h_svc_domain->sql_h_search(@_),
+            FS::h_svc_domain->sql_h_searchs(@_),
           );
 }
 
index 231f9df..a436815 100644 (file)
@@ -29,7 +29,7 @@ sub srcsvc_acct {
   my $self = shift;
   qsearchs( 'h_svc_acct',
             { 'svcnum' => $self->srcsvc },
-            FS::h_svc_acct->sql_h_search(@_),
+            FS::h_svc_acct->sql_h_searchs(@_),
           );
 }
 
@@ -41,7 +41,7 @@ sub dstsvc_acct {
   my $self = shift;
   qsearchs( 'h_svc_acct',
             { 'svcnum' => $self->dstsvc },
-            FS::h_svc_acct->sql_h_search(@_),
+            FS::h_svc_acct->sql_h_searchs(@_),
           );
 }
 
index f2f8af8..c6f347d 100644 (file)
@@ -29,7 +29,7 @@ sub domain_record {
   my $self = shift;
   qsearchs( 'h_domain_record',
             { 'recnum' => $self->recnum },
-            FS::h_domain_record->sql_h_search(@_),
+            FS::h_domain_record->sql_h_searchs(@_),
           );
 }
 
index 921bbc9..9916fed 100644 (file)
@@ -64,6 +64,7 @@ FS/cust_credit_refund.pm
 FS/cust_svc.pm
 FS/h_Common.pm
 FS/h_cust_svc.pm
+FS/h_domain_record.pm
 FS/h_svc_acct.pm
 FS/h_svc_broadband.pm
 FS/h_svc_domain.pm
@@ -185,6 +186,7 @@ t/cust_svc.t
 t/h_cust_svc.t
 t/h_Common.t
 t/h_cust_svc.t
+t/h_domain_record.t
 t/h_svc_acct.t
 t/h_svc_broadband.t
 t/h_svc_domain.t
diff --git a/FS/t/h_domain_record.t b/FS/t/h_domain_record.t
new file mode 100644 (file)
index 0000000..f48e72e
--- /dev/null
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::h_domain_record;
+$loaded=1;
+print "ok 1\n";